1 /* Sample winestub.c file for compiling programs with libwine.so. */
8 extern int PASCAL
WinMain(HINSTANCE
,HINSTANCE
,LPSTR
,int);
9 /* This is the renamed main() subroutine in misc/main.c. */
10 /* Note that the libdll `init()' won't work: */
11 extern HINSTANCE
_wine_main(int, char *[]);
13 int main (int argc
, char *argv
[])
16 char szCmdParam
[256] = {0};
17 int index
, buffer_pos
;
19 /* "Wired-in" command-line options for Wine: */
20 /*char *wine_argv[] = {argv[0], "-managed", "-dll", "+commdlg",
21 "-dll", "+shell", ""};*/
22 char *wine_argv
[] = {argv
[0], ""};
24 /* Initialize the library dll: */
25 hInstance
= (HINSTANCE
)_wine_main((sizeof(wine_argv
)/sizeof(char *))-1, wine_argv
);
28 fprintf(stderr
,"In winestub, reporting hInstance = %d\n", hInstance
);
31 /* Move things from argv to the szCmdParam that WinMain expects: */
32 for (index
= 1, buffer_pos
= 0;
33 (index
< argc
) && (buffer_pos
< 255);
34 index
++, buffer_pos
++)
36 for (arg_holder
= argv
[index
]; ; buffer_pos
++, arg_holder
++)
37 if ((szCmdParam
[buffer_pos
] = *arg_holder
) == '\0') break;
38 szCmdParam
[buffer_pos
] = ' ';
40 szCmdParam
[buffer_pos
] = '\0';
43 fprintf(stderr
,"In winestub, Program Name: %s, Parameters: %s\n",
44 progname
, szCmdParam
);
47 return WinMain (hInstance
, /* hInstance */
48 0, /* hPrevInstance */
49 (LPSTR
)szCmdParam
, /* lpszCmdParam */
50 SW_NORMAL
); /* nCmdShow */