Wednesday, January 2, 2013

Creating Registry file Using PowerBuilder

OLEObject PBObject
String GUID
long ll_rtn
PBObject = CREATE OLEObject
ll_rtn = PBObject.ConnectToNewObject("PowerBuilder.Application")
If ll_rtn < 0 Then
   MessageBox("Connect Error","Could not connect to OLE Automation object")
   Return
Else
   //Set the library list
   PBObject.LibraryList = "c:\projects\tax\tax.dll"
   //Specify the library compilation type
   PBObject.MachineCode = True
   //Generate the GUID
   ll_rtn = PBObject.GenerateGUID( REF GUID)
   If ll_rtn < 0 Then
      MessageBox ("Generation Error","Could not generate GUID.")
      Return
   Else
      //Generate the registration file
      ll_rtn = PBObject.GenerateRegFile( GUID, "u_tax_calc", "Tax.Object", 1, 0, &
      "Tax calculations", "c:\projects\tax\tax.reg")
      If ll_rtn < 0 Then
         MessageBox( "Generation Error", "Could not generate registration file")
      End If
   End If
End If

No comments:

Post a Comment