Embedding problems???

Jr. King n at n.com
Mon May 17 10:49:24 EDT 1999


I have this code here
// learnPyth.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "python.h"
#include "stdio.h"
#include <iostream.h>

int main(int argc, char* argv[])
{
 Py_Initialize();
 char input[200];
 int ret;
 FILE *fp;
 fp = fopen("miniedit.py","r+");
 if(fp == NULL)
  cout<<"Didn't open file";
 else{
  ret = PyRun_AnyFile(fp,"miniedit.py");
  cout<<ret;
  fclose(fp);
 }
 printf("Hello World!\n");
 return 0;
}

I crashes with what looks like a illegal access error, inside of ntdll.dll I
think.  Looks like it stems from an fget.  Any Ideas on what I need to do.
This is a MSVC++ 6.0 on NT 4.0 sp4.  The MSVC app is default as in I didn't
change any switches and I only add the python.lib thingy.






More information about the Python-list mailing list