Skip to main content

Problem:

Is it possible to add version information to a COBOL .dll or .exe?

Resolution:

It is possible to add your own version details to an .exe or .dll.

First of all, you need to create an .RC file. Create the .RC file using a text editor - an example of the contents and parameters of the .RC file are below:

1 VERSIONINFO                                                          

  FILEVERSION    1,1,1,1                                               

  PRODUCTVERSION 1,0,0,0                                               

  FILEFLAGS      0                                                     

BEGIN                                                                  

  BLOCK "StringFileInfo"                                               

  BEGIN                                                                

    BLOCK "04090000"            /* lang-charset : US. English, ACSII */

    BEGIN                                                              

      VALUE "CompanyName",      "Micro Focus Limited\\0"       

      VALUE "FileDescription",  "Micro Focus Net Express Demo\\0"            

      VALUE "FileVersion",      "1.00,1.00\\0"                          

      VALUE "InternalName",     "VersioNo\\0"                           

      VALUE "LegalCopyright",   "Copyright (C) 1999\\0"                 

      VALUE "LegalTrademarks",  "Micro Focus\\0"                             

      VALUE "OriginalFileName", "VersioNo.EXE\\0"                       

      VALUE "ProductName",      "Micro Focus Net Express\\0"                 

      VALUE "ProductVersion",   "3.0.14\\0"                             

    END                                                                

  END                                                                  

END                

Let's say we've saved this file as VERSION.RC

Next, build the VERSION.RC file as a .res file, using the following command from a Net Express command prompt:

RC -R VERSION.RC

Now you can build the .DLL using the newly created VERSION.RES file:

cbllink -d version.res progname.cbl

Go to explorer and then right click on the new DLL created, and select the version tab. You'll see that it will contain the entries specified in the RC file.

Old KB# 6998