Hi,
I should make a project that works on PDA (PPC2003) in C++ and it should connect to a server via GPRS technology. I've tried this sample code but it returns E_FAIL in HRESULT after the function
HRESULT hr = ConnMgrEstablishConnectionSync(&pConnInfo, &hConnection,15000, &dwStatus);
Can you please help me?
staticvoid startGPRS()
{
CONNMGR_CONNECTIONINFO pConnInfo;
ZeroMemory(&pConnInfo, sizeof(CONNMGR_CONNECTIONINFO));
pConnInfo.cbSize = sizeof(CONNMGR_CONNECTIONINFO);
pConnInfo.dwPriority = CONNMGR_PRIORITY_HIPRIBKGND;
pConnInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
pConnInfo.bExclusive = false;
pConnInfo.bDisabled = false;
pConnInfo.guidDestNet = IID_DestNetInternet;
HANDLE hConnection = NULL;
DWORD dwStatus;
char* IPAddress;
MessageBox(NULL,L"here",L"Error",MB_OK);
HRESULT hr = ConnMgrEstablishConnectionSync(&pConnInfo, &hConnection,15000, &dwStatus);
MessageBox(NULL,L"here2",L"Error",MB_OK);
if (hr != S_OK)
{
char error[100];
//_snprintf(error,100,"Couldn't Start GPRS - Error returned: %s",hr);
MessageBox(NULL,CA2W(error),L"Error",MB_OK);
}
else
{
MessageBox(NULL,L"done",L"Error",MB_OK);
}
CloseHandle(hConnection);
}
Thanks.
I should make a project that works on PDA (PPC2003) in C++ and it should connect to a server via GPRS technology. I've tried this sample code but it returns E_FAIL in HRESULT after the function
HRESULT hr = ConnMgrEstablishConnectionSync(&pConnInfo, &hConnection,15000, &dwStatus);
Can you please help me?
staticvoid startGPRS()
{
CONNMGR_CONNECTIONINFO pConnInfo;
ZeroMemory(&pConnInfo, sizeof(CONNMGR_CONNECTIONINFO));
pConnInfo.cbSize = sizeof(CONNMGR_CONNECTIONINFO);
pConnInfo.dwPriority = CONNMGR_PRIORITY_HIPRIBKGND;
pConnInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
pConnInfo.bExclusive = false;
pConnInfo.bDisabled = false;
pConnInfo.guidDestNet = IID_DestNetInternet;
HANDLE hConnection = NULL;
DWORD dwStatus;
char* IPAddress;
MessageBox(NULL,L"here",L"Error",MB_OK);
HRESULT hr = ConnMgrEstablishConnectionSync(&pConnInfo, &hConnection,15000, &dwStatus);
MessageBox(NULL,L"here2",L"Error",MB_OK);
if (hr != S_OK)
{
char error[100];
//_snprintf(error,100,"Couldn't Start GPRS - Error returned: %s",hr);
MessageBox(NULL,CA2W(error),L"Error",MB_OK);
}
else
{
MessageBox(NULL,L"done",L"Error",MB_OK);
}
CloseHandle(hConnection);
}
Thanks.