LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MessageBox function problem

I'm trying to use the win32 function MessageBox() in a static library
I'm creating in LabWindows. The static library will contain test
functions for CVI TestExec. LabWindows creates the static library
just fine but whenever TestExec trys to load it an undefined
references error occurs. I'm using LabWindows/CVI full development
system. If I comment out the call to MessageBox() and recreate the
static library then TestExec has no problem loading the library. The
reason I want to use win32 MessageBox() instead of the LabWindows
MessagePopup() is because the source file that will use it needs to be
usable in other win32 development environments not just LabWindows. I
want that source file to not contain any CVI dependent code.

How do I call
the win32 function MessageBox() function in LabWindows?

Thanks
0 Kudos
Message 1 of 2
(2,800 Views)
You would have to manually link in the dependent SDK library into the TestExec process. When compiling the TestExec EXE, CVI doesn't know you will be using that library in the other lib file since you are loading it dynamically with LoadExternalModule. So you have to manually link it into the testexec process. To do this, open the testexec project, go to Build->Target Settings... Then, under Add Files to Executable, add the lib file from the SDK that has the SDK function in it. In this case, I think it is user32.lib.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 2
(2,800 Views)