Adapting the Object Class ID Syntax to the Language

When you create an object using VBScript, you indicate the class ID of the object to create in the following way:

Dim cls
Set cls = model.CreateObject(PdOOM.cls_Class)

This syntax works properly for VBScript, VBA and VB, but it does not work for other languages, as class Ids constants are defined as an enumeration. Only languages that support enumeration defined outside a class can support this syntax.

For C# and VB.NET, you can use the following syntax:

Dim cls As PdOOM.Class
Set cls = model.CreateObject(PdOOM.PdOOM_Classes.cls_Class)
'Where PdOOM_Classes is the name of the enumeration.

For other languages such as JavaScript or PowerBuilder, you have to define constants that represent the objects you want to create.

For a complete list of class ID constants, see file VBScriptConstants.vbs in the PowerDesigner OLE Automation directory.