Solved

urgent::code to connect pc and mobile

Posted on 2006-11-23
2
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Make the most of your online learning experience.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

632 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