Solved

urgent::code to connect pc and mobile

Posted on 2006-11-23
2
212 Views
Last Modified: 2010-04-16
Hi,
I have written a code as suggested(from the link: http://www.codeproject.com\ce\mobileconnect.asp).
but i want to know how my pc will automatically detect the mobile connected via usb and give a notification that it is connected or not .

Thanks and Regards,
Sal

0
Comment
Question by:ddipro
2 Comments
 
LVL 8

Accepted Solution

by:
deadite earned 500 total points
ID: 18006481
Your link to the code didn't work.  I'm not sure what language you are using...  If you are interested in determining connected USB devices, here is a vbscript that returns the connected USB devices

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colDevices = objWMIService.ExecQuery _
    ("Select * From Win32_USBControllerDevice")

For Each objDevice in colDevices
    strDeviceName = objDevice.Dependent
    strQuotes = Chr(34)
    strDeviceName = Replace(strDeviceName, strQuotes, "")
    arrDeviceNames = Split(strDeviceName, "=")
    strDeviceName = arrDeviceNames(1)
    Set colUSBDevices = objWMIService.ExecQuery _
        ("Select * From Win32_PnPEntity Where DeviceID = '" & strDeviceName & "'")
    For Each objUSBDevice in colUSBDevices
        Wscript.Echo objUSBDevice.Description
    Next    
Next


You can modify the code a bit by adding a simple if statement to match your mobile device.  Then just run the script and it will let you know if it is connected.
0
 

Author Comment

by:ddipro
ID: 18006637
thanks for ur coperation
but i m writing this code using  mfc, c++ and win32 as described in the given link.
So i need help related to these field only

thanks,
sal
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 98
countX 22 80
how to send memory stream from ics Client To ics server ? 11 79
C# code editing and collaboration 3 98
A short article about problems I had with the new location API and permissions in Marshmallow
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now