VC dll问题

来源:百度知道 编辑:UC知道 时间:2024/06/25 15:49:53
int GetWebCon(char *url,char * wCon)
{
CInternetSession httpSession;
CInternetFile* htmlFile = (CInternetFile*) httpSession.OpenURL(url);
CString content;

while (htmlFile->ReadString(content))
{
content+=content;
}
//AfxMessageBox(content, 0, 0);
(CString)(*wCon)=content;
htmlFile->Close();
httpSession.Close();

return 0;
}

有点晕,想用VC写一个dll,通过这个dll获取网页内容。结果出了一堆问题。主要是上面3处。第一处提示"debug assert failed".
第二处发现content的内容越加越少。

第三个嘛,就是不知道怎么把content的内容传给调用函数。。。。
CInternetSession httpSession;

另外一个是这里,呵呵,帮我看看吧

int GetWebCon(char *url,CString& wCon)
{
CInternetSession httpSession;
CInternetFile* htmlFile = (CInternetFile*) httpSession.OpenURL(url);
CString content;

while (htmlFile->ReadString(content))
{
wCon+=content;
}
//AfxMessageBox(content, 0, 0);
htmlFile->Close();
httpSession.Close();

return 0;
}

另外第一个问题,你这段代码无法看到