//Here call c functuon in the dll (testdll.dll)
int nTest = 10;
char pStr[] = "Now,I am run in the testdll";
PointAndInt TestStruct;
TestStruct.nData = 100;
ZeroMemory(&TestStruct.pStr,256);
memcpy(TestStruct.pStr,pStr,strlen(pStr));
testdll(fp,nTest,&TestStruct);
}
--------------------------------------------------------------------------------------
dll code:
void testdll(FILE* fp,int nTest,PPointAndInt pArg)
{
int nTemp = nTest;
char strTemp[256];
printf("This is a test data from argument: %d\n",nTemp);
printf("This is a string in the struct:%s\n",pArg->pStr);
printf("This is a data in the struct:%d\n",pArg->nData);
fscanf(fp,"%s",strTemp); <------ exception
fprintf(fp,"Now,it is in testdll");//,code:%d",nTemp); <------ exception