]>
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
7 * Copyright: (c) Robert Roebling
8 * Licence: wxWindows licence
9 *****************************************************************************/
15 extern int PASCAL
WinMain( HINSTANCE
, HINSTANCE
, LPSTR
, int );
16 extern HINSTANCE
MAIN_WinelibInit( int *argc
, char *argv
[] );
18 /* Most Windows C/C++ compilers use something like this to */
19 /* access argc and argv globally: */
23 int main( int argc
, char *argv
[] )
29 _ARGV
= (char **)argv
;
31 if (!(hInstance
= MAIN_WinelibInit( &argc
, argv
))) return 0;
33 /* Alloc szCmdParam */
34 for (i
= 1; i
< argc
; i
++) len
+= strlen(argv
[i
]) + 1;
35 lpszCmdParam
= (LPSTR
) xmalloc(len
+ 1);
36 /* Concatenate arguments */
37 if (argc
> 1) strcpy(lpszCmdParam
, argv
[1]);
38 else lpszCmdParam
[0] = '\0';
39 for (i
= 2; i
< argc
; i
++) strcat(strcat(lpszCmdParam
, " "), argv
[i
]);
41 return WinMain (hInstance
, /* hInstance */
42 0, /* hPrevInstance */
43 lpszCmdParam
, /* lpszCmdParam */
44 SW_NORMAL
); /* nCmdShow */