Re: GetDefaultCommConfig fails for "\\\\.\\COM15"

Tech-Archive recommends: Fix windows errors by optimizing your registry



they are stored where GetdefaultCommConfig can find them.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Tosca" <tb@xxxxxxxx> wrote in message
news:uIW4n$UZGHA.1580@xxxxxxxxxxxxxxxxxxxxxxx
Jochen Kalmbach [MVP] wrote:
Hi Tosca!
default comm config is a very legacy concept. every app that i know
of that uses a com port just sets the port to its own config b/c it
knows best.

OK, but how do I convert a devicename from "\\\\.\\COM15" TO "COM15" and
make GetDefaultCommConfig accept it even if it is not below COM9?

AFAIK, what Doron wanted to say is:

It makes absolutely no sence to get the "default" values. You should set
every member ob the DCB structure explicit!
Well the user might configure the com port using the _device manager_,
and than once again in my program. Actually he'd have to do that every
time he installs my program or any other compatible program that uses
the same com port that probably he's got the same device hooked to it.


I know of some applications which had used the "GetDefaultCommConfig"
and they wounderd why their app works on some machine and on other not.
The problem was, that they implicit used different settings for the DCB
because the called "GetDefaultCommConfig"...

So please: never call "GetDefaultCommConfig" nor "GetCommState" to
initialize your serial port!
Fine, that's what I'll do.
Do you know the com port settings configured in _device manager_ are
stored? I could read them from the source.



Is it possible to open the port via CreateFile?

Yes, CreateFile opens COM ports COM9 and up with a syntax like this:
"\\\\.\\COM???".
And GetDefaultCommConfig does not. I must use "COM1-9" for it.
My problem is that this syntax is not supported by all communication
functions.
Sorry, I lied, I don't care about it. Just if someone could send a word
to Microsoft that GetDefaultCommConfig fails for "\\\\.\\COM15".

//Tosca


.



Relevant Pages

  • Re: GetDefaultCommConfig fails for "\\.\COM15"
    ... of that uses a com port just sets the port to its own config b/c it ... every member ob the DCB structure explicit! ... I know of some applications which had used the "GetDefaultCommConfig" ...
    (microsoft.public.win32.programmer.kernel)
  • Re: GetDefaultCommConfig fails for "\\.\COM15"
    ... uses a com port just sets the port to its own config b/c it knows best. ... make GetDefaultCommConfig accept it even if it is not below COM9? ... You should set every member ob the DCB structure explicit! ... I know of some applications which had used the "GetDefaultCommConfig" and they wounderd why their app works on some machine and on other not. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: com ports
    ... experiences with GetDefaultCommConfig(). ... This API will also report any virtual com ports that are available due to ... To check whether the port is in use by another application or not just open ...
    (microsoft.public.vb.general.discussion)
  • Re: GetDefaultCommConfig fails for "\\.\COM15"
    ... Doron Holan wrote: ... uses a com port just sets the port to its own config b/c it knows best. ... make GetDefaultCommConfig accept it even if it is not below COM9? ...
    (microsoft.public.win32.programmer.kernel)