LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does MScomctl.ocx throw a server exception in my LabVIEW executable when trying to set the ImageList?

I am using the Microsoft Toolbar Control 6.0 (SP4) toolbar to display 32x32 pixel buttons.
 
In development, this toolbar works flawlessly. Once the program is compiled, however, the function iToolbar: ImageList(putRef) sometimes gives the error "Error -2147417851 occurred at The server threw an exception. "
 
This error does not alway happen, and when it doesn't happen, everything works normally.
 
Anyone have an idea why this error is being generated?
0 Kudos
Message 1 of 6
(3,265 Views)
Does this happen on the development machine when you run it as an executable? If the problem is intermittent, are you sure it never happens when you run the application in LabVIEW?
Jarrod S.
National Instruments
0 Kudos
Message 2 of 6
(3,249 Views)
It does not seem to be related to which machine the executable is run on. I have installed the program on a handful of other computers. The frequency of the error seems to change slightly, but is never eliminated completely.
 
I don't recall ever seeing this error in the development mode.
 
I'm thinking that it might be a problem with the registry.
0 Kudos
Message 3 of 6
(3,247 Views)
I managed to strip away my entire application and limit the problem to just the toolbar and images. Please see file included.
 
If you want to play with it, you will have to make a build script. Your system will need to have activex components installed.
 
Mscomctl.ocx is required.
 
As I said above, this code fragment works ok in LabVIEW development mode, but occasionally fails when built into an executable. When it fails, it seems to fail many times in a row. It doesn't seem to be a timing problem because there is only one thread.
 
Has anyone else out there had this problem and found a solution?

Message Edited by terminalman90 on 08-10-2005 11:34 AM

0 Kudos
Message 4 of 6
(3,236 Views)

I can't find this ActiveX component on my system, so I wasn't able to reproduce your issue. This component, however, does have a number of issues, specifically with the ImageList function that have fixes available from www.msdn.com. Search for Mscomctl.ocx for more information.

These issues include potential problems when using Windows XP.

One of these issues could be causing the server exception, though I am unaware why it would only happen when packaged into an executable, and intermittently at that.
Jarrod S.
National Instruments
0 Kudos
Message 5 of 6
(3,219 Views)

We didn't really determine exactly what the problem was, but we discovered a work-around. There is something in the configuration of our ActiveX and the buttons we load that causes the crashes. We haven't been able (so far) to isolate which config is causing the trouble. But we find that if we drop in a fresh ActiveX toolbar and programmatically add the buttons the crashing disappears.

One caveat, however... If you run the program in development mode and then save changes to the container front panel with the configured ActiveX control, it reintroduces the crashing. This is especially concerning since you only encounter the crashing in the executable version and it only crashes periodically. You wouldn't want to accidentally introduce this bug and have it slip through your testing and have your customers discover it for you.

If anyone else has this trouble and can shed some light on the root cause, please let me know.

0 Kudos
Message 6 of 6
(3,202 Views)