LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble displaying a file selection dialog box called from within a ActiveX Callback event.

I am using third party ActiveX calls that contain some callback events. One of those events indicates that a necessary file was not found. I would like to then give the user an option to browse or exit. I have coded it so that a message box appears from the callback asking if they want to browse for the file. In the same callback I determine if the user says yes and if so I call the "File Dialog" in Labview. When I run the application I get the message box from the callback, but when I select Yes to browse the dialog never comes up and the application hangs and I have to kill it with the Task Manager. I know that it is calling the File Dialog because when I select no it exits out properly. Is there a problem in calling visible vi's from a callback and if so how would I do what I indicated?
0 Kudos
Message 1 of 4
(2,600 Views)
i have exactly the same problem (MSCOMCTL\ToolBar\ButtonClick, WinXP SP2, LV 7.0): One Button Dialog displayed properly, File Dialog executed, but invisible. this behaviour is passed even to subvis of the callback.vi. i tried different settings with reentrant vis, execution systems etc., but no effect. now i use the callback.vi just to send a message or to fire a dynamic event, the actual code is then executed by a vi which listens to the messages/dynamic events and is not a subvi of the callback.vi.

is this a bug or feature?

anyone got an answer?
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 4
(2,573 Views)
Thanks for the response. One thing I was able to do for the File Dialog was to create the ActiveX reference for the File Dialog in the COMMDLG32.dll, pass in the reference and perform the show method. This works great for the File Dialog. However, now I am needing to have a unique dialog that gives the user information and have him respond to it. It would be nice to be able to call a vi straight from the callback routine. I can't believe we are the only people needing to do this.

I forgot to mention that I am running LV 7.1 under Windows XP.
0 Kudos
Message 3 of 4
(2,546 Views)
Hi

i think a got a workaround: call the vi containing the file dialog (lets name it dialog.vi) within the callback.vi dynamically with options "Wait until done" == FALSE and "Auto Dispose Ref" == TRUE (don't close the reference of dialog.vi after the invoke node). Then the built in LV File Dialog will show up. All other combinations of the settings lock the callback.vi.

By doing so you completly leave the hierarchy of the callback.vi (The control of the vi-reference is given to dialog.vi), so the behaviour is back to normal.

Because "Wait until done" == TRUE locks the callback.vi you have to be pretty careful with events occuring while dialog.vi is still executing, but i think you can handle this by checking the execution state of dialog.vi before execution.

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 4 of 4
(2,539 Views)