大家帮我看看有什么问题吧
就这么一点代码,不知怎么回事,只要用上,程序就喜欢自动退出,或者因为出现叫做什么 内存访问无效(英文,我自己瞎翻的)什么的错误而退出!
我实在没有看出错在哪儿,谁给点意见?
int ClassName::Send(LPSTR QQNumber, LPSTR msgin,LPSTR msgout)
{
CString m_download,cmsgin(msgin);
char * m_location;
CInternetSession mySession;
CInternetFile * myFile=NULL;
m_location="http://localhost/?";
strcat(m_location,msgin);
try
{
myFile=(CInternetFile*)mySession.OpenURL(m_location,1,INTERNET_FLAG_RELOAD,0);
}
catch(CInternetException * pEx)
{
myFile=NULL;
pEx->Delete();
return 0;
}
if(myFile)
{
CString line;
for(int i=0;i<10 && myFile->ReadString(line);i++)
m_download+=line+"\r\n";
myFile->Close();
delete myFile;
}
if(m_download=="")
{
m_download+="Error!";
}
wsprintf(msgout,"%s",m_download);
msgin="";
return 1;
}