How to detect PDA connection

G

Guest

Is there a way to detect when a PDA is connected to the PC without using the
ActiveSync events that are exposed in OpenNETCF's RAPI?

Thanks
-G
 
G

Guest

Thanks Sergey,

This helped a lot. Does the OpenNETCF RAPI expose the COM-based IDccMan and
IDccManSink??

Thanks
-G
 
S

Sergey Bogdanov

OpenNETCF ActiveSync.cs and IDccMan.cs class uses IDccMan and
IDccManSink. If you just want that application would be notificated then
see "Registry-based Notification" section in my previous post.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 
G

Guest

I read the information from your post. That's what prompted my question
about the IDccMan/IDccManSink.

I want to be able to install my app onto a desktop, get connection and
disconnection information to my app -- I do not just want my app to start
when the device is connected. I want to be able to do this without the
presence of ActiveSync. It looks like the OpenNETCF RAPI depends on
ActiveSync being installed. Is that right? If so, is there anyway to
accomplish such a task?

Thanks
-G
 
G

Guest

Nevermind....I'll shutup now. :-/

**found it**

GS-SE said:
I read the information from your post. That's what prompted my question
about the IDccMan/IDccManSink.

I want to be able to install my app onto a desktop, get connection and
disconnection information to my app -- I do not just want my app to start
when the device is connected. I want to be able to do this without the
presence of ActiveSync. It looks like the OpenNETCF RAPI depends on
ActiveSync being installed. Is that right? If so, is there anyway to
accomplish such a task?

Thanks
-G
 
G

Guest

I don't want to add anything to the registry that will autostart my app. I
want my app to only get a notification of connection/disconnection when the
app is running. However, ActiveSync may not be installed on all the machines
this app will run on.

Would I be able to use the IDccMan.cs interface class in my own app to give
me that functionality?

Thanks
-G
 
G

Guest

well u can manually check for pc connectivity using the following code:
which i found on
http://www.devbuzz.com/content/zinc_network_connectivity_pg1.asp

Imports System.Net
#Region "Enums"
Public Enum CradleResult As Integer
Cradled = 0
Uncradled = 1
WebException = 2
OtherException = 3
End Enum
#End Region


'Class Definition here
Const Home as String = "127.0.0.1"
#Region "Functions"
Public Shared Function IsDeviceCradled() as CradleResult
Try
Dim HostName as String = Dns.GetHostName()
Dim IPHost as System.Net.IPHostEntry = Dns.GetHostByName(HostName)
Dim DeviceIP as String = CType(IPHost.AddressList(0), String)
If DeviceIP <> IPAddress.Parse(Home).ToString Then
Return CradleResult.Cradled
Else
Return CradleResult.Uncradled
End If

Catch webEx as System.Net.WebException
Return CradleResult.WebException
Catch othEx as System.Exception
Return CradleResult.OtherException
End Try

End Function
#End Region
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top