Jump to content

ActiveX object problem in built application


Recommended Posts

Hi all,

I have a problem with an external code developed in VB 6.0, I am accesing it from Labview 8.20 using the "Automation Open" to have access to properties and methods, the code works just fine in development environment and if the executable build is ran in the same laptop I use for the development. The problem shows when I try to run my labview code in a different machine, I have created the same directory structures to avoid any problem related to location of the right activex, in fact you can see that the Labview .exe applicatioon is actually calling the activex object because is opened but when it's supossed to execute several methods within these activex it does not do anything, I have realized that because the main function of the activex should be to Open the Com Port, I have Serial Monitor software spying the Com Port activity and does not do anything. Any idea why it works as .exe in the laptop where I developed and not in a different machine.

PD The Laptop has Windows Vista Enterprise and the PC where I want this to work is an XP Pro

Thanks for any help I am sure it should be a minor detail I am no seeing

Link to comment

QUOTE (Jorge Moreno @ Mar 9 2009, 02:20 PM)

Hi all,

I have a problem with an external code developed in VB 6.0, I am accesing it from Labview 8.20 using the "Automation Open" to have access to properties and methods, the code works just fine in development environment and if the executable build is ran in the same laptop I use for the development. The problem shows when I try to run my labview code in a different machine, I have created the same directory structures to avoid any problem related to location of the right activex, in fact you can see that the Labview .exe applicatioon is actually calling the activex object because is opened but when it's supossed to execute several methods within these activex it does not do anything, I have realized that because the main function of the activex should be to Open the Com Port, I have Serial Monitor software spying the Com Port activity and does not do anything. Any idea why it works as .exe in the laptop where I developed and not in a different machine.

PD The Laptop has Windows Vista Enterprise and the PC where I want this to work is an XP Pro

Thanks for any help I am sure it should be a minor detail I am no seeing

Do make certain that the relevant ActiveX objects are on the distro computer and are correctly registered there.

Link to comment

QUOTE (Jorge Moreno @ Mar 9 2009, 05:20 PM)

Hi all,

I have a problem with an external code developed in VB 6.0, I am accesing it from Labview 8.20 using the "Automation Open" to have access to properties and methods, the code works just fine in development environment and if the executable build is ran in the same laptop I use for the development. The problem shows when I try to run my labview code in a different machine, I have created the same directory structures to avoid any problem related to location of the right activex, in fact you can see that the Labview .exe applicatioon is actually calling the activex object because is opened but when it's supossed to execute several methods within these activex it does not do anything, I have realized that because the main function of the activex should be to Open the Com Port, I have Serial Monitor software spying the Com Port activity and does not do anything. Any idea why it works as .exe in the laptop where I developed and not in a different machine.

PD The Laptop has Windows Vista Enterprise and the PC where I want this to work is an XP Pro

Thanks for any help I am sure it should be a minor detail I am no seeing

ActiveX components need both be installed and registered on the PC you want to run them. Your Automation Nodes most probably throw errors (in the error out cluster) that you might have forgotten to handle, so the LabVIEW application tries to tell you that it can not load, initialize, or execute the ActiveX component but your lack of error handling hides that from you.

Since a VB component also needs the according VB runtime installed it would be best to create a component installer in VB for your component which will also take care about bundling the right runtime and possibly other support libraries and on installation register all the necessary components on the target system. Then run that installer along with the installer for the LabVIEW application.

Rolf Kalbermatter

Link to comment

Thanks for your comments Val and Rolfk, from what you mentioned both I did before some of your recommendations and still did not work, in your case Rolfk I had error handling but not at the startup or Top VI, I added that this morning and I got the following error displayed in the error cluster:

"Error loading type library/DLL"

The problem resides in that I did not know the nature of the Activex object I was using, I am developing an application and R&D Engineers from other site did not want to share information about the interface controlled by this Activex nor the Activex itself due to security policies from their group, so I had to find out myself how to access these methods and properties to develop a Test Platform for a new product. After browsing for info on this error I found two useful links which I am attaching below:

http://digital.ni.com/public.nsf/websearch...EC?OpenDocument

http://digital.ni.com/public.nsf/websearch...7A?OpenDocument

In my case the Activex object turn out to be an Activex Server instead a .OCX, when I tried to use rgsvr32 to register it as a .OCX I got the following error:

...\ActivexObjectName.exe was loaded, but the DLLUnregisterServer entry point was not found

...\ActivexObjectName.exe does not appear to be a .DLL or .OCX file.

After reading from the knowledge base at NI how to register an Activex Server then I did:

...\ActivexObjectName.exe /RegServer

And it worked!!!!!

I hope this help help other with similar problems than my application

Thanks

Jorge Moreno

Link to comment

QUOTE (Jorge Moreno @ Mar 10 2009, 10:13 AM)

Thanks for your comments Val and Rolfk, from what you mentioned both I did before some of your recommendations and still did not work, in your case Rolfk I had error handling but not at the startup or Top VI, I added that this morning and I got the following error displayed in the error cluster:

"Error loading type library/DLL"

The problem resides in that I did not know the nature of the Activex object I was using, I am developing an application and R&D Engineers from other site did not want to share information about the interface controlled by this Activex nor the Activex itself due to security policies from their group, so I had to find out myself how to access these methods and properties to develop a Test Platform for a new product. After browsing for info on this error I found two useful links which I am attaching below:

http://digital.ni.com/public.nsf/websearch...EC?OpenDocument

http://digital.ni.com/public.nsf/websearch...7A?OpenDocument

In my case the Activex object turn out to be an Activex Server instead a .OCX, when I tried to use rgsvr32 to register it as a .OCX I got the following error:

...\ActivexObjectName.exe was loaded, but the DLLUnregisterServer entry point was not found

...\ActivexObjectName.exe does not appear to be a .DLL or .OCX file.

After reading from the knowledge base at NI how to register an Activex Server then I did:

...\ActivexObjectName.exe /RegServer

And it worked!!!!!

I hope this help help other with similar problems than my application

Thanks

Jorge Moreno

Good detective work! This is the biggest problem with using ActiveX objects: it's the Wild West out there and anything that is not explicitly forbidden, is allowed. And there ain't a whole lot that's forbidden!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.