LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can i call winmain function in labview

hello everyone,

Well i have written a C++ code that uses the  winmain function (windows function). i want to convert this code into dll and call that dll into labview.
Is it possible to  call winmain function as one of the functions in labview. Please let me know as soon as possible.

Thank you.

Royal  tiger......
0 Kudos
Message 1 of 2
(2,153 Views)
You didn't say what development environment you're using, so I'm assuming Visual Studio. It sounds like you created a Win32 app (as opposed to an MFC app). This has a "WinMain" function. The prototype for WinMain is geared towards it being called by the OS when you run the executable. You could just add the __declspec(export) directive in front of the return type, but you also need to change some build functions in Visual Studio to get a DLL. You probably also don't need all the arguments that WinMain uses. You're probably better off by starting with a new DLL project in order to get the framework for a DLL, and then copy and past the function code. That's what I would do.

I would also strongly suggest that you crack open the "Using External Code in LabVIEW" manual that gets installed when you installed LabVIEW. It's in the "manuals" directory, filename of "lvexcode.pdf".
0 Kudos
Message 2 of 2
(2,144 Views)