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