Discussion:
InternetGetConnectedState crash
(too old to reply)
z***@gmail.com
2007-01-12 07:11:05 UTC
Permalink
I am new comer in WinInet..
i have to check internet connection exist or not ,i wrote this code
DWORD outFlag=0;
bool isConnect = InternetGetConnectedState(&outFlag,0);
this is wroking fine, but one particular system giving crash when try
to call this method(access violation ).

DWORD *outFlag=new DWORD;
bool isConnect = InternetGetConnectedState(outFlag,0);

and tried this way
typedef _stdcall bool pF(LPDWORD,DWORD);
pF *checkState ;
HMODULE hMod=::LoadLibrary("wininet.dll");
checkState =(pF*) ::GetProcAddress(hMod,"InternetGetConnectedState");
bool k = checkState(flag,0);

this is also crashing..
please correct me if i did any mistake..
z***@gmail.com
2007-01-12 09:55:24 UTC
Permalink
one more strange result,if i try to debug with break point (put break
point just before this function call)if i ht F5 it is crashing ,if i
hit F10 it is working fine..
Post by z***@gmail.com
I am new comer in WinInet..
i have to check internet connection exist or not ,i wrote this code
DWORD outFlag=0;
bool isConnect = InternetGetConnectedState(&outFlag,0);
this is wroking fine, but one particular system giving crash when try
to call this method(access violation ).
DWORD *outFlag=new DWORD;
bool isConnect = InternetGetConnectedState(outFlag,0);
and tried this way
typedef _stdcall bool pF(LPDWORD,DWORD);
pF *checkState ;
HMODULE hMod=::LoadLibrary("wininet.dll");
checkState =(pF*) ::GetProcAddress(hMod,"InternetGetConnectedState");
bool k = checkState(flag,0);
this is also crashing..
please correct me if i did any mistake..
Vladimir Scherbina
2007-01-12 17:58:30 UTC
Permalink
Most likely this is the problem of buggy LSP or FireWall software.
--
Vladimir (Windows SDK MVP)
http://msmvps.com/blogs/v_scherbina/
Post by z***@gmail.com
I am new comer in WinInet..
i have to check internet connection exist or not ,i wrote this code
DWORD outFlag=0;
bool isConnect = InternetGetConnectedState(&outFlag,0);
this is wroking fine, but one particular system giving crash when try
to call this method(access violation ).
DWORD *outFlag=new DWORD;
bool isConnect = InternetGetConnectedState(outFlag,0);
and tried this way
typedef _stdcall bool pF(LPDWORD,DWORD);
pF *checkState ;
HMODULE hMod=::LoadLibrary("wininet.dll");
checkState =(pF*) ::GetProcAddress(hMod,"InternetGetConnectedState");
bool k = checkState(flag,0);
this is also crashing..
please correct me if i did any mistake..
Loading...