// This gets run when the DLL is loaded. We just need to save a handle.
//----------------------------------------------------------------------
+extern "C"
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
int argc = 0;
char** argv = NULL;
blocked = wxPyBeginBlockThreads();
+
PyObject* sysargv = PySys_GetObject("argv");
- if (sysargv != NULL) {
- argc = PyList_Size(sysargv);
+ PyObject* executable = PySys_GetObject("executable");
+
+ if (sysargv != NULL && executable != NULL) {
+ argc = PyList_Size(sysargv) + 1;
argv = new char*[argc+1];
+ argv[0] = PyString_AsString(executable);
int x;
- for(x=0; x<argc; x++) {
- PyObject *pyArg = PyList_GetItem(sysargv, x);
+ for(x=1; x<argc; x++) {
+ PyObject *pyArg = PyList_GetItem(sysargv, x-1);
argv[x] = PyString_AsString(pyArg);
}
argv[argc] = NULL;
setlocale(LC_NUMERIC, "C");
#endif
+ wxSystemOptions::SetOption(wxT("mac.textcontrol-use-mlte"), 1);
+
// The stock objects were all NULL when they were loaded into
// SWIG generated proxies, so re-init those now...
wxPy_ReinitStockObjects(3);