سؤال

We are trying to switch between WiFi and GPRS depending upon the availability of the network. We are also using OpenNETCF for the network activity.

Is there any callback methods available in the OpenNETCF or .NET Framework to get a notification whenever connection is available or gone?

Or can anyone direct me to a sample code for the same.

Note: We need a solution compatible with running on both Windows Mobile 5.0 and Windows CE.

هل كانت مفيدة؟

المحلول

What you're looking for is called the Connection Manager. It has existed since the first version of WinCE to support cell phones. It's available on the OEM type Windows CE as well, but I'm not sure if that only has the native code functions.

You can set up a callback function to be notified of changes in the connection status or have your window sent a message. Full documentation is available here:

MSDN documentation for Connection Manager

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top