Home > Community > Discussion Forums

Measurement Studio for VC++

Showing results for 
Search instead for 
Do you mean 
Posts: 113

Displaying a VC++ dialog box in LabVIEW

I'm not using Measurement Studio but this question is about VC++. I have created a regular DLL with MFC extension and I'm able to convert it to the .lsb format to use with the CIN in labview. My problem is that I know how to call single functions or different functions that I define but when it comes to calling DoModal to display a dialog box the whole thing crashes in labview. I was hoping you could point me in the right direction as to what I have to do to be able to pop up an MFC dialog in Labview. (What to do in VC++, and perhaps what kind of block diagram to have in labview to run it), Thanks in advance,
Active Participant
Posts: 211

Re: Displaying a VC++ dialog box in LabVIEW

Alex- I think I already posted an answer to your follow up question about doing this with a dll. Because of the threading problems, I'm not sure it will work with a CIN.
Posts: 38

Re: Displaying a VC++ dialog box in LabVIEW

Try using a non-MFC dialog box, and create a dll instead of a cin - probably not exactly what you want to do, but the odds of success should be much greater Smiley Wink. Even a non-MFC dialog box from a cin would be better.

MFC only supports the STA (single thread apartment) model. I'm pretty sure LabView is free threaded - ie you must use the WTL (Windows Template Library, beta in the current Platform SDK) or the Win32 API which support that threading model.