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

GenerateTypeLib function – PB Docs 70 – PowerBuilder Library

GenerateTypeLib function – PB Docs 70

GenerateTypeLib function



Description

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

Access

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 documentationYou can also specify a value of the PowerBuilder enumerated data
type 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 filename 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 filename was provided
  • 3 Can’t 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 filename
  • 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 only need it 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, before you
create the Type Library file, a valid registry update file must
exist for the object. 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 be creating a TypeLib
entry in the registry that isn’t 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. (Don’t
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 may receive these exception codes from
the PowerBuilder automation server:

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.

Indented lines are continuations of the previous line. They
would appear as a single line in the actual file:


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