المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : COM port number identification



C++ Programming
03-30-2009, 10:02 AM
Hello to all,
In my project I am using a device which when I connect to the computer to the USB port, computer creates a virtual port as "USB Serial Port (COM X)" where X stands for port number which will be any.Then I open that port and reads data, as per normal communication port opening and reading/writting operations. Now what I want to do is, is there any mechanism of finding your computer's communication port numbers so that I need not to look what the port number is while opening that port. Means when I will start my application I will directly get that COM port number where my device is connected and then there will be no need of selecting the correct COM port number in my application to open it.
So please does anyone know that, is there any such kind of mechanism which will directly give me the COM port number where my device is connected or any mechanism which will directly give you your computer's communication port numbers? Please its really very very urgent so help me.

Thanks and Regards,

Anay