Hi, I have wince running on my IPAQ and am writing an application that needs to detect whether wireless connection (802.11b) is present or not. Basically, if it is then I want to launch IE. I am doing that using the code as below:
==Start code.
bool AppTester::LaunchIE()
{
SHELLEXECUTEINFO sei;
memset(&sei, 0, sizeof (sei));
sei.cbSize = sizeof (sei);
sei.fMask = 0 ;
sei.lpParameters = "www.cnn.com";
sei.lpFile = _T("IEXPLORE.EXE");
sei.lpVerb = _T("Open");
if(ShellExecuteEx (&sei) == 0)
{
TCHAR szError[100];
wsprintf(szError,_T("Error calling ShellExecuteEx: %d"),GetLastError());
MessageBox(NULL,szError,_T("Error"),MB_OK);
return FALSE;
}return TRUE;
}
====End code.
My development environment is using embedded visual c++.
Now my question is, If connection is available IE will launch with no problem and web page will be shown (using above code). But, if no connection is available IE will still launch but will time out after sometime and say "Page you are looking for cannot be found"
What I want is to keep the user of the IPAQ transparent from the connection. Hence, I need to test before launching IE and see if connection is available or not. Is it is, then I can simply launch the web page. Else I want to display some other page that I have in my cache.
Hopefully, my question can be understood. So, is there a way in my program I can detect for presence of network connection before hand????
I would appreciate if you can give me some sample code to look at.
Thanks