LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Couldn't see VC++ dialog message to labview

Hi

My problem is that I have a MFC Dll in VC++ and this dll sends dialog messages. When I call the function from LabVIEW 6 the dialog box doesn't appears.

I try it with this example:

AfxMessageBox("Starte Dialog mit DoModal");
ODlg_NumberEdit oDlg;
oDlg.DoModal();
AfxMessageBox("Nach Dialog mit DoModal");

Thanks for help

jens
0 Kudos
Message 1 of 3
(2,738 Views)
Jens,

The thread which calls the dialog box must be apartment threaded. Since LabVIEW threads are initialized for a different thread model, a LabVIEW thread cannot directly call an MFC dialog. You would need to create a temporary thread, initialize it correctly, and then call the dialog box from this temporary thread. The original thread waits on the temporary thread to finish and then returns back to LabVIEW.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,738 Views)
Thank for help

with the statement:

AfxBeginThread(ThreadProc,THREAD_PRIORITY_NORMAL);

UNIT ThreadProc(LPVOID pParam)
{

return 0;
}

the dialog box appears

Jens
0 Kudos
Message 3 of 3
(2,738 Views)