1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
4 * GUI support by Robert Webb
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
11 * Windows GUI: main program (EXE) entry point:
13 * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code.
23 /* cproto doesn't create a prototype for main() */
25 #if defined(FEAT_GUI_W32)
30 __ARGS((int argc
, char **argv
));
31 static int (_cdecl
*pmain
)(int, char **);
36 void _cdecl
SaveInst(HINSTANCE hInst
);
38 static void (_cdecl
*pSaveInst
)(HINSTANCE
);
58 /* Ron: added full path name so that the $VIM variable will get set to our
59 * startup path (so the .vimrc file can be found w/o a VIM env. var.) */
60 GetModuleFileName(NULL
, prog
, 255);
62 argc
= get_cmd_args(prog
, (char *)lpszCmdLine
, &argv
, &tofree
);
65 MessageBox(0, "Could not allocate memory for command line.",
70 #ifdef DYNAMIC_GETTEXT
71 /* Initialize gettext library */
72 dyn_libintl_init(NULL
);
76 // LoadLibrary - get name of dll to load in here:
77 p
= strrchr(prog
, '\\');
81 strcpy(p
+1, "vim32d.dll");
83 strcpy(p
+1, "vim32.dll");
86 hLib
= LoadLibrary(prog
);
89 MessageBox(0, _("Could not load vim32.dll!"), _("VIM Error"), 0);
92 // fix up the function pointers
94 pSaveInst
= GetProcAddress(hLib
, (LPCSTR
)2);
96 pmain
= GetProcAddress(hLib
, (LPCSTR
)1);
99 MessageBox(0, _("Could not fix up function pointers to the DLL!"),
105 pSaveInst
= SaveInst
;
108 # if defined(FEAT_GUI_W32)
109 //&& defined(__MINGW32__)
119 GetModuleHandle(NULL
)