01-12-2012 07:15 AM
Hi,
I have a dll compiled under LV2011 and want to use it inside CVI routines (CVI2010 under Win7)
In general all looks very fine but dialog boxes. Whenever there is a message to be popped up I see only its blank window and a CVI program hangs.
I created a dummy function in this dll with only a dialog box, just to check whether something else doesn't influence this. Works the same, I mean hangs. No text is displayed, just freezed empty dialog window.
This dll was running correctly previously, when compiled under LV7.1 and running under CVI2010 under WinXP.
Is there any solution for such behaviour??
Thanks for help.
01-16-2012 05:48 AM
Hi Slawomir,
Can you send me please the code you used to reproduce the problem?
I'll take a look on it, and hope we'll find some solution 😉
Best Regards,
Tamas
01-17-2012 02:15 AM
Hi,
I attached simple CVI environment with compiled dll to be called. There is also problematic vi included.
Please take a look, maybe you can figure out something.
01-17-2012 09:40 AM
Hello,
I guess this happens because the dll doesn't pass the full information about the user dialogs that are defined by LV 2011.
Why don't you defined the user dialog in CVI? What is it your final goal?
Kind regards,
Ion R.
01-17-2012 10:05 AM
Hi ion.rosca
what do you mean by:
@ion.rosca wrote:
I guess this happens because the dll doesn't pass the full information about the user dialogs that are defined by LV 2011.
A comment in dialog box is not a result of functions in my dll. Dialogs appear during the execution and impact the further steps.
So obviously I need them be called from LV.
I think however that standard two button dialog box should not be problematic for CVI to be handled.
01-17-2012 03:39 PM
When you need to show the LabVIEW UI in a DLL function, it cannot be running in the main thread. In LabVIEW, you would normally set the Call Library Function node to use "Run in any thread" instead of "Run in UI thread". In CVI, or other text based languages, you must spawn a new thread an run the DLL function there. The following code should help you out:
int CVICALLBACK ThreadFunction (void *functionData) { int i=0; i = TestKomentarza(4,"jdksjkdjslk"); return 0; } int CVICALLBACK test (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { CmtThreadFunctionID myThread; switch (event) { case EVENT_COMMIT: CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, ThreadFunction, NULL, &myThread); break; } return 0; }