[python-win32] getting access violation error in kernel32.dll while debugging
Mark Hammond
mhammond@skippinet.com.au
Tue, 14 May 2002 21:21:02 +1000
You probably don't have the runtime libraries set correctly. You must use
"multi-threaded in a DLL", aka the /MD compiler option (/MDd for debug
builds)
Mark.
> -----Original Message-----
> From: python-win32-admin@python.org
> [mailto:python-win32-admin@python.org]On Behalf Of Marcus
> Sent: Tuesday, 14 May 2002 5:40 PM
> To: Python
> Subject: [python-win32] getting access violation error in kernel32.dll
> while debugging
>
>
> Hello!
> I want to embbed C source code with a python script, named
> modulefile.py. Here´s the intresting part of my c code:
>
> void getValues(char **firstName, char **lastName, char **profession) {
>
> FILE *fp = NULL;
> PyObject *module, *fn, *ln, *prof;
> int res;
>
> module = PyImport_AddModule("__main__");
>
> fp = fopen("modulefile.py","r");
> res = PyRun_SimpleFile(fp,"modulefile.py");
> }
> void main(int argc, char *argv[]) {
>
> char *firstName, *lastName, *profession;
>
> Py_Initialize();
> PySys_SetArgv(argc, argv);
> getValues(&firstName, &lastName, &profession);
>
> After the debugger reaches the statemant:
>
> res = PyRun_SimpleFile(fp,"modulefile.py");
>
> I get a access violation error in kernel32.dll. Have anyone got an idea
> what happend ?
> All the examples in the source code
> (D:\home\...\Python-2.2.1\Demo\embed) are working, so it does´nt seem to
> be a compiler configuration error.
>
> Thanks a lot, greetings
> Marcus
>
>
>
>
>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32