]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/winestub.c
1 /****************************************************************************
2 * Name: src/msw/winestub.cpp
3 * Purpose: wxWINE module mapping main() to WinMain()
4 * Author: Robert Roebling
6 * Copyright: (c) Robert Roebling
7 * Licence: wxWindows licence
8 *****************************************************************************/
14 extern int PASCAL
WinMain( HINSTANCE
, HINSTANCE
, LPSTR
, int );
15 extern HINSTANCE
MAIN_WinelibInit( int *argc
, char *argv
[] );
17 /* Most Windows C/C++ compilers use something like this to */
18 /* access argc and argv globally: */
22 int main( int argc
, char *argv
[] )
28 _ARGV
= (char **)argv
;
30 if (!(hInstance
= MAIN_WinelibInit( &argc
, argv
))) return 0;
32 /* Alloc szCmdParam */
33 for (i
= 1; i
< argc
; i
++) len
+= strlen(argv
[i
]) + 1;
34 lpszCmdParam
= (LPSTR
) xmalloc(len
+ 1);
35 /* Concatenate arguments */
36 if (argc
> 1) strcpy(lpszCmdParam
, argv
[1]);
37 else lpszCmdParam
[0] = '\0';
38 for (i
= 2; i
< argc
; i
++) strcat(strcat(lpszCmdParam
, " "), argv
[i
]);
40 return WinMain (hInstance
, /* hInstance */
41 0, /* hPrevInstance */
42 lpszCmdParam
, /* lpszCmdParam */
43 SW_NORMAL
); /* nCmdShow */