Edit ActiveX Server Wizard — Edit ActiveX Object Advanced Options Panel
Use this dialog box to edit the following advanced options for ActiveX objects.
- Callback Function—The name of the callback function for the object. The name of the function must be a valid C identifier. If you specify and implement a callback function, LabWindows/CVI calls it with the CA_SERVER_EVENT_OBJECT_CREATE event when the object is being created and calls it with the CA_SERVER_EVENT_OBJECT_DESTROY event when the object is being discarded. If the callback function returns a failure error code in response to the CA_SERVER_EVENT_OBJECT_CREATE event, the object is not created. LabWindows/CVI ignores the return value of the callback function for the CA_SERVER_EVENT_OBJECT_DESTROY event. By default, the object does not have a callback function. Refer to the Generated ActiveX Server Files and Code topic for more information about the semantics of the callback function.
- ProgID—Select Use Default if you want the ActiveX Server Wizard to generate a default Programmatic Identifier (ProgID) for the object. ProgIDs provide ActiveX clients with a user-friendly way to identify the ActiveX object. The format of the generated default ProgID is serverName.objectName. If you do not want to use the default ProgID, uncheck Use Default and enter the ProgID for your object.
LabWindows/CVI stores the ProgID in the registry when the object is registered. The recommended format of the ProgID is VendorName.ObjectName. ProgID should not contain any spaces or punctuation characters (including underscores), but it can contain one or more periods. Also, ProgID should not start with a digit and should not exceed 39 ASCII characters (bytes) when combined with the version, for example, VendorName.ObjectName.Version. - Version—Select the version number for creating the versioned ProgID. Make sure that the version number is greater than or equal to 1.
- Object Type—Select the type of the object for EXE servers.
- SDI Application Object—Select this type for the top-level object of a Single Document Interface (SDI) executable server. A document is an object that encapsulates the data, such as the text in Microsoft Word or the spreadsheet data in Microsoft Excel, relevant to the application. SDI applications can manage only a single document at a time. If you need to edit multiple documents, you must open each document in a different instance of the application.
- MDI Application Object—Select this type for the top-level object of a Multiple Document Interface (MDI) executable server. With an MDI application, you can open and edit multiple documents concurrently. Notice that although there is no direct way to create MDI applications in LabWindows/CVI, the LabWindows/CVI User Interface Library provides enough flexibility and functionality for you to create an MDI-like Graphical User Interface (GUI) for your applications. If you create an MDI GUI for your application, such as a report generation application, NI recommends that you select MDI Application Object as the object type for the application object.
- Document Object—Select this type for the document objects, which normally have a user interface, in an SDI or MDI executable server. Document objects encapsulate the data relevant to the application.
- Custom Object—The only type available in DLL servers. You can customize all the advanced options for a custom object.
By default, the first specified object in an EXE server is a SDI Application object and subsequent objects are Custom objects. You also can select MDI Application and Document as the type for objects in an EXE server. - Top-level Object—Select this option if the custom object is a top-level object. By default, custom objects are top-level objects. This setting is available only for custom objects. Application objects (SDI and MDI) always are top-level objects. Document objects are top-level in an MDI application but are not top-level in an SDI application.
- Support Aggregation—Select this option if the object is aggregatable. By default, the object is aggregatable.
- Support ErrorInfo—Select this option if the object's interfaces support setting rich error information using IErrorInfo and related functions. By default, the object does not support setting rich error information.
- Serve Single Client—Select this option if the object serves a single client at a time. By default, objects can serve multiple clients.
- Register As Active Object—Select this option if you want the object registered in the Running Object Table (ROT). This setting is available only for custom objects. By default, the object is not registered as an active object. If an ActiveX object is registered in the ROT, then other ActiveX clients can get references to this particular object by requesting the COM runtime for the active object. This option can be useful if you want to expose resources like hardware ports/channels that cannot be accessed by multiple clients simultaneously. Such resources can be exposed by an ActiveX object that registers itself as the active object when it is created by an ActiveX client. Other clients that also want to access the resource can get a reference to this object and access the resource. Application objects (SDI and MDI) are always registered in the ROT. Document objects are not registered in the ROT. LabWindows/CVI registers an active object as a weak reference in the ROT. When a client gets and releases a weak reference, the active object is removed from the ROT. Subsequent attempts to get the active object from the ROT fail. To make the active reference strong, you can call CA_ServerLockActiveObject, which prevents the active reference from being removed from the ROT when clients release their references to the active object.
- GUID (CLSID)—LabWindows/CVI automatically generates a CLSID for the server. To use a different GUID, enter a new CLSID. You must specify the CLSID in registry format. You can use the guidgen.exe utility from Microsoft to generate GUIDs. For more information and to obtain guidgen.exe, refer to the Microsoft Web site.