Jump to content

LV DLL Multiple Instance: Does not receive closing event


Recommended Posts

I have a C# application that allows the user to open multiple MDI windows. Each MDI window is an empty parent window for a LabVIEW DLL where the controls and front panel (form) is defined in the main VI of the LabVIEW DLL. Each MDI window opens the LabVIEW main VI on a new thread. If I open four MDI / LabVIEW windows of the same LabVIEW main VI and close them in the reverse order in which they were opened, then everything seems to shut down properly. However, if I open four MDI / LabVIEW windows of the same LabVIEW main VI and close the one that was opened first, then the first window shuts down properly, but the fourth one opened closes only the LabVIEW portion of the window (the child of the MDI) and leaves the C# MDI empty parent window still visible. The LabVIEW DLL is both reentrant (in the VI properties) and AllowMultipleInstances = TRUE (in the .ini file).

So I am wondering if calling this VI in a LabVIEW DLL is truly a multiple instance (since two of my four instances were closed when I only clicked one Close box)?

Or, maybe there is something more I need to do in LabVIEW to be able to run a VI in a LabVIEW DLL as a separate instance each time it is called from C#?

Further info:

Each MDI window is an empty parent window for a LabVIEW DLL where the controls and front panel (form) is defined in the main VI of the LabVIEW DLL. When the user closes the C# MDI parent window, I want to also close the child LabVIEW window. I have tried sending a WM_CLOSE message to the handle of the child window, but my LabVIEW DLL does not receive an “Application Instance Close?” event or a “Panel Close?” event. Is there an event that is fired by the LabVIEW VI when a C# application sends it a WM_CLOSE message? If so, what event should be handled in the VI’s event case structure? Or, if the WM_CLOSE message cannot be mapped into an event that is handled in an event case structure, how should it be handled? If there is not an event that is fired by the LabVIEW VI when a C# application sends it a WM_CLOSE message, then wh

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.