devxlogo

OLE Automation Versus Standalone Mode

OLE Automation Versus Standalone Mode

There you are, creating an OLE server in Visual Basic. You go to Options in the Tools menu, select the Project tab, choose “OLE Server,” and click on OK. After compiling, you run the executable. Is it an OLE server? Unfortunately, it’s not.What makes a VB4 application an OLE server? You need at least one class module whose Public property is set to True and whose Instancing property is set to either “Creatable SingleUse” or “Creatable MultiUse.”At this point, however you still do not have an OLE server: you have an application that is OLE Automation-enabled. If you were to create an instance of the exposed class via OLE Automation from another application, then it would be an OLE server. If the application is run normally, it is a standalone application.What is the purpose of the StartMode option in the Project options? Is this strictly for the design environment? When you are testing an OLE server with two copies of Visual Basic running, the one with “OLE Server” chosen can be started and will continue running even if no form ever loads. This feature allows the second copy of VB to test OLE Automation against the first. In addition, the first creates a temporary registry entry so that early binding may be tested as well.On another note, don’t forget about the StartMode property of the App object. You can determine whether the app was started as a standalone or as an OLE server. Excel, for example, makes use of this by showing itself if it is a standalone, or by hiding itself if it is run via OLE Automation.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist