LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

WinMain command line parameters

Hello All,
I thought it would be easy replacing main() by WinMain()...

I need to do this because of a limitation in the number of arguments you can
pass with main (I assume that WinMain is not limited). I want to be able to
drop a huge number of files on my app and process them. But how do you read
the command line parameters from WinMain ?

This page ( http://msdn2.microsoft.com/en-us/library/ms647232.aspx ) says to
use:

#include <windows.h>
#include <shellapi.h> // ?
#include <cvirte.h> ...
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpszCmdLine, int nCmdShow) {
if (InitCVIRTE (hInstance, 0, 0) == 0) return -1;
Argv = CommandLineToArgvW(GetCommandLineW(), &Argc);

But then the linker fails with:
Undefined symbol '_CommandLineToArgvW@8' referenced in "ImageRenamer.c".

What's missing from the linkage ?
--
Guillaume Dargaud
http://www.gdargaud.net/Climbing/


0 Kudos
Message 1 of 2
(5,150 Views)
Well, as often is the case, I just found the solution in
C:\Program Files\National Instruments\CVI81\sdk\sdkfuncs.txt
where it says I have to link with SHELL32.LIB

Sorry, it's been a while since I last used WinSDK functions. I'm more into
Linux now.
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 2 of 2
(5,150 Views)