IonicWind Software

IWBasic => General Questions => Topic started by: Andy on April 26, 2015, 05:29:40 AM

Title: Com port description / name
Post by: Andy on April 26, 2015, 05:29:40 AM
Sorry to ask another question but...

I have at times 2 com ports connected to my PC

one is for LPT1 & one for my USB to serial device.

I can enumerate how many com ports are open e.g. 2, and the com port numbers for each.

But is there a way to get the "Description" of what each com port is there for?

At the moment, I can't buy the com add-on for IWB, so is there a way to do this without it....

Thanks,
Andy.

:)

Title: Re: Com port description / name
Post by: Egil on April 26, 2015, 09:37:53 AM
Only way I can think of is to open Windows' Device manager, and check if the drivers has assigned names to the external devices.


Egil
Title: Re: Com port description / name
Post by: Brian on April 26, 2015, 12:33:29 PM
Andy,

I don't have have any COM ports, but does this work for you?

Brian
Title: Re: Com port description / name
Post by: Andy on April 26, 2015, 11:47:41 PM
Thanks Egil and Brian for your suggestions.

I have managed to do it - see attached code.

You must use the attached "Registry.inc" file.

Any problems compiling / running please let me know.

However, it must be run on a user account that is an Administrator type account.

I was just wondering if there was a way to get the same details is you were a standard user.

Thanks,
Andy.
:)
Title: Re: Com port description / name
Post by: ckoehn on April 27, 2015, 07:15:41 AM
Adding this manifest file to your projects lets your program run, even if it isn't started with administrator privliges.

It opens 2 console windows for some reason... :-\

Later,
Clint
Title: Re: Com port description / name
Post by: Andy on April 28, 2015, 05:37:15 AM
Thanks,

I downloaded the manifest file, saved it into the same folder as the program but it didn't make a difference
for me.

I'm on Win7 32 bit. (User account controls are off).

Thanks anyway.

Andy.
:)
Title: Re: Com port description / name
Post by: ckoehn on April 28, 2015, 09:38:30 AM
I think I had to actually include it in a "project" resource file for it to work for me.  Not sure what the difference is.

Here is the resouce file I used.

Later,
Clint
Title: Re: Com port description / name
Post by: Brian on April 28, 2015, 09:58:02 AM
Clint,

if you don't include it as a resource, I suppose the manifest file would have to be
named exactly the same as the exe file it is paired with

Brian

Silly Me! Just checked the filename, and it was OK!