Discussion Forums > Technology
Programming Questions | Repositories
kitamesume:
[reserved]
Question: my USB-to-Serial's commport changes every time i re-plug it, and its pissing me off to edit the script every time, how can i make it automatically connect to the commport by itself?
Answer: N/A (pending for an answer)
Question: i'm searching for a free OS, distributable as well, mainly for VB6 programming and/or executing the program itself, what OS would you recommend and where can i get it? possibly an easy to manipulate OS and least problematic at that.
Answer: N/A (pending for an answer)
--- Quote ---resources:
http://msdn.microsoft.com/en-us/vstudio/ms788232
--- End quote ---
kitamesume:
i'm having troubles with usb-to-serial on VB6, what i usually do is that:
--- Quote ---install the drivers that come with it; reboot pc; plug in the USB cable (doesn't have to be connected to device on other end); go to Control Panel, "Ports" to confirm it's now enabled in Windows and to see which Comm port it is now - mine was Comm 2. Finally, go to the VB code and edit it to find Comm 2. In my case, the code was originally, "MSComm1.CommPort = 1" I simply had to change it to "MSComm1.CommPort = 2".
--- End quote ---
now the troublesome part is that when ever i replug the usb-to-serial adapter the CommPort changes ._. , and i have to make it automatically adjust to define MSComm1.CommPort by itself, so how would i do that o.o.
something like:
MSComm1.CommPort = variable1
where as how should i define variable1 to self trace the usb-to-serial adapter...
rkruger:
My knowledge of the Win32 API is limited, but isn't it possible to make a function to simply search for the serial port?
Just make a for loop and probe all ports from 1 to X and see which one does NOT give errors, then assign that one to your variable.
kitamesume:
i think i've heard of that before... can't recall where and how to do it =/
rkruger:
--- Quote from: kitamesume on March 18, 2012, 11:37:21 AM ---can't recall where and how to do it =/
--- End quote ---
If you can stand the pain, you can start by searching and reading through the entire archaic Win32 API reference on Microsoft's MSDN pages.
http://msdn.microsoft.com/en-us/vstudio/ms788232
Ganbatte kudasai!
Navigation
[0] Message Index
[#] Next page
Go to full version