Why does MScomctl.o​cx 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?

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
Attachments:
terminalman90.zip ‏37 KB

Similar Messages

Maybe you are looking for