RASDIALPARAMS pParams; HRASCONN hRas; DWORD dwRetVal; DWORD dw_ret; RASCONNSTATUS status; hRasInstance = LoadLibrary("RASAPI32.DLL"); fRasDial = (pRasDial)GetProcAddress(hRasInstance, "RasDialA"); fRasGetErrorString = (pRasGetErrorString)GetProcAddress(hRasInstance, "RasGetErrorStringA"); fRasEnumConnections = (pRasEnumConnections)GetProcAddress(hRasInstance, "RasEnumConnectionsA"); fRasHangUp = (pRasHangUp)GetProcAddress(hRasInstance, "RasHangUpA"); fRasGetConnectStatus = (pRasGetConnectStatus)GetProcAddress(hRasInstance, "RasGetConnectStatusA") pParams.dwSize = sizeof(RASDIALPARAMS); // I've tried 816, 1052 and 1060 hRas = 0; dwRetVal = fRasDial(NULL, NULL, &pParams, 1, RasCallback, &hRas); // dwRetVal is always a 0. dw_ret = fRasGetConnectStatus(hRas, &status); if(dw_ret) { // Display the error. Is always a 632. }
status.dwSize = sizeof(RASCONNSTATUS);
6==ERROR_INVALID_HANDLE
#define WINVER 0x0501 //xp
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)