Hi ,
I try to provide a generic solution to close GPRS connection. Please give me
some help.
1. My application use ConnectionManager to establish GPRS connection. See
the code below:
CONNMGR_CONNECTIONINFO ConnInfo;
ZeroMemory(&ConnInfo, sizeof(ConnInfo));
ConnInfo.cbSize = sizeof(ConnInfo);
ConnInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
ConnInfo.bExclusive = FALSE; //my application cannot accept TRUE option
ConnInfo.dwPriority = CONNMGR_PRIORITY_USERBACKGROUND;
ConnInfo.guidDestNet = DestInfo.guid;
ConnInfo.hWnd = TERMINAL->HWnd();
ConnInfo.uMsg = TERMINAL->m_nConnMgrNotificationsMsg;
hResult = ConnMgrEstablishConnection(&ConnInfo, &connection_handle);
if(FAILED(hResult))
{
connection_handle = NULL;
return FALSE;
}
2. Later I try to close the connection by
if (connection_handle != NULL)
{
HRESULT hResult = ConnMgrReleaseConnection(connection_handle, 0);
if (FAILED(hResult))
return FALSE;
connection_handle = NULL;
}
3. The result is : GPRS cannot be disconnected immediately.
4. I tried another solution for closing GPRS immediately, by using
RasEnumConnections and RasHangUp.
But the problem is RasEnumConnections cannot find any connection on some
device like HTC VOX. So this solution failed on some
special device.
5. I tried another solution: use GetInterfaceInfo to get all adapters and
use IpReleaseAddress to close all of them.
Unfortunately, on smart phone 2005, it does not work. (Worked on PPC)
So, could you please help me out of this trouble, how do you do in your
application.
Thanks alot.
Archived from group: microsoft>public>pocketpc>developer>networking