Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Sample registry update file – PB Docs 105 – PowerBuilder Library

Sample registry update file – PB Docs 105

GenerateTypeLib function



Description

Creates a file with type library information for a PowerBuilder
object you are deploying as an automation server.

Controls

PowerBuilder.Application (automation server)

Syntax

Argument Description
automationobject When PowerBuilder is the OLE client,
the name of the OLEObject instantiated with the PowerBuilder.Application automation
server. For other clients, use syntax appropriate for calling a
function belonging to an automation object.
classguid A String whose value
is the globally unique identifier (GUID) that you used for the object
when you generated its registry file
classname A String whose value
is the name of the object in the PowerBuilder library for which
type information will be generated.

classname should be the same name you
specified when you generated the registry file.

progid A String whose value
is the programmatic identifier that people will use to connect to
your server.

progid should be the same value you specified
when you generated the registry file.

localeid A Long whose value
is the locale identifier (LCID) for the language of your object.
Values for specific languages are defined in Microsoft documentation.

You can also specify a value of the PowerBuilder enumerated datatype LanguageID.

majorversion An Integer whose
value you specified for the major version number of your server
object.
minorversion An Integer whose
value you specified for the minor version number of your server
object.
description A String whose value
you specified as the description of your server object.
helpcontext A Long whose value
is the context ID for a Help topic in helpfile.
Specify 0 to display the Help file’s contents page.
helpfile A String whose value
is the name of a Help file containing Help topics for your server
object.
typelibguid A String whose value
will be the globally unique identifier (GUID) for the TypeLib information
in the registry.
typelibfilename A String whose value
is the name of the file GenerateTypeLib will
create. The default file name extension recognized by the registry
is TLB.
registryfilename A String whose value
is the name of the registry update file generated for this object
with GenerateRegFile.

If you just want to generate a type library, specify an empty string
for registryfilename.

Return Values

Long. Returns a status code indicating
whether an error occurred. Values are:

  • 0 The registry update file was generated successfully.
  • 2 No output file name was provided.
  • 3 Cannot create the type library.
  • 4 Invalid name or error setting name.
  • 5 Invalid locale identifier or error setting the locale identifier.
  • 6 Error converting the TypeLib GUID to a CLSID.
  • 7 Invalid GUID or error setting GUID.
  • 7 Error setting description.
  • 9 Error setting version.
  • 10 Error setting Help context.
  • 11 Error setting Help file name.
  • 14 Class not found in the libraries specified in LibraryList.
  • 18 Error converting ClassName GUID to CLSID.
  • 30 Error loading standard type library (OLE is not installed
    correctly).
  • 31 Error getting IUnknown type information (OLE is not installed
    correctly).
  • 32 Error getting IDispatch type information (OLE is not installed
    correctly).
  • 36 Error opening the registry update file associated with this
    type library.

Usage

The type library is optional. You need it only if you want
OLE browsers to display information about the properties and methods
of your object.

If you want to register your type library, then a valid registry
update file must exist for the object before you create the Type
Library file. The process of creating the Type Library adds information
to the registry update file.

To generate the registry update file, see the GenerateRegFile function.

The values you specify for the arguments of GenerateTypeLib must
match the values in the associated registry update file that has
already been created. Otherwise, you will create a TypeLib entry
in the registry that is not associated with any object.

Before you call GenerateTypeLib, you must
start a PowerBuilder.Application session and set the LibraryList
and MachineCode properties to the values for the server object.
You also need two GUIDs, the GUID used for the object’s CLSID
(specified when you created the registry update file) and a GUID
for the type library itself. For information about the format of
a GUID, see the GenerateGUID function.

After you generate the registry update and type library files,
you can register the object in the registry on your system or on
other systems.

When you register your object in the registry, it stores information
about the locations of the library file and the type library file.
The path you specified for the LibraryList property specifies its
location or must be in the path. The type library file should be
in its intended directory when you register the object.

Examples

This example calls GenerateTypeLib.
(Do not use this GUID in your own applications.)

This example establishes a PowerBuilder.Application server
session and sets all the values necessary for generating a registry
update file:

See Also

  • GenerateGUID
  • GenerateRegFile

Exception codes

Automation clients accessing a PowerBuilder server may generate
OLE exceptions under certain circumstances. When user actions cause
an exception, PowerBuilder populates the EXCEPINFO structure passed
by the caller with an exception code identifying the type of exception.
For a PowerBuilder client, the exception information is passed as
arguments to the ExternalException event.

Client applications might receive these exception codes from
the PowerBuilder automation server:

Table 20-10: PowerBuilder automation server exception codes
Code Meaning
1001 Memory allocation failure.
1002 Requested Object is not in the library
list.
1003 Object create failed.
1004 Binary format does not match version
or is out of date.
1005 Property accessed as an array is not
an array.
1006 Unexpected error executing script.
1007 No method was found matching the requested
name and argument types.
1008 Unable to convert variant argument type.

Sample registry update file

This sample registry file has registration information for
a class user object named uo_salarydata.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x