PDA

View Full Version : help me again!!!!


xhd0926
09-15-2003, 01:10 AM
Why cann't get true html data by the AEEWeb?

My code:
////////////////////////////////////////////////////////////////
static void GetWebConnection(CHelloWorldApp*pMe)
{
........
char url[] = "http://www.dot.ca.gov/dist11/d11tmc/sdmap/speeds/nb5.html";
if (ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_WEB, (void**)(&pMe->m_pIWeb)) != SUCCESS)
{
xStatus(pMe, 1, IDS_ERR_IWEB_FAILED);
WebCleanup(pMe);
return;
}

CALLBACK_Init(&pMe->m_Callback, WebReadCB, pMe);
IWEB_GetResponse(pMe->m_pIWeb, (pMe->m_pIWeb, &pMe->m_pIWebResp, &pMe->m_Callback, url,
WEBOPT_HANDLERDATA, pMe,
WEBOPT_STATUSHANDLER, WebStatusNotification,
WEBOPT_END));

}

static void WebReadCB(void* cxt)
{
CHelloWorldApp* pMe = (CHelloWorldApp*)cxt;
WebRespInfo* pWebRespInfo = IWEBRESP_GetInfo(pMe->m_pIWebResp);
int ByteCount;
char buf[128];

if (pWebRespInfo )&& WEB_ERROR_SUCCEEDED(pWebRespInfo->nCode))
{
ISource* pISource = pWebRespInfo->pisMessage;
ByteCount = ISOURCE_Read(pISource, (char*)buf, sizeof(buf));
.......
}
..........
}
...........
//////////////////////////////////////

But the "pWebRespInfo->nCode" value is 400, why?
help me!!
thank you very very much!!!

ruben
09-15-2003, 09:19 AM
Read the section under "Important information about WEBOPT lifetimes" in the BREW SDK pdf file. Your URL lifetime is not correct.

ruben