Timmy16bmx
Timmy16bmx

Reputation: 13

Why is activeX failing to create an object from a Labview executable?

Here is my scenario. I am using Quicktest Pro (VB) to create an ActiveX object from a Labview VI that I built into an executable. In the build specs of the VI I have enabled ActiveX server option (ActiveX server name: "MyLabviewProgram") and in the VI Tools>Options>VI Server: Configuration the ActiveX box is checked.

So in QTP my code is:

Set IvApp = CreateObject("MyLabviewProgram.Application")
Set Vi = IvApp.getVIReference("MyLabviewVI.vi")
Vi.Call ParamNames, ParamVals

Upon running this I get a Run Error on the first line:

ActiveX component can't create object: 'MyLabviewProgram.Application'

I am having trouble figuring out why it errors. From National Instruments website they have a step in on one of their community pages about "LabVIEW Executable Used as ActiveX Server". The step is after building the EXE, 5. Run the EXE at least once on the target to activate the .TLB file. I've run the executable but not sure what they mean by on the target.

Does anyone have a suggestion on what I need to do to get this working?

Upvotes: 1

Views: 1721

Answers (1)

David Gladfelter
David Gladfelter

Reputation: 4213

Your description sounds like you correctly created a vi .exe. "On the Target" probably means "On the Target PC". The EXE adds all COM registration entries to the Windows registry each time it is executed.

It sounds like you haven't verified the COM registration entries are present in the registry yet. That's the first debugging step.

Run regedit.exe and search for MyLabviewProgram.Application under the HKEY_CLASSES_ROOT sub-key. You should find an entry that contains a sub-key that contains a value that contains a GUID (a large hexadecimal number).

That "class ID" GUID should be referenced under the HKCR/CLSID key. That reference should contain a LocalServer32 sub-key with the default value pointing to your application's .EXE filepath with the /Automation argument appended.

It seems likely that one of these steps will fail. I can't say exactly which one without more information.

Upvotes: 1

Related Questions