Results 1 to 7 of 7

Thread: Getting Com Port Settings

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47

    Question Getting Com Port Settings

    Hi,

    Is there any way to get the com port settings of a com port in use or not in use??? i.e. baud, parity, data bits, IRQ, Address.
    Dave

  2. #2
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149
    Use the Microsoft Comm Control. I beleive however this only works with ports that are opened by the application. If you are looking for getting information from a commport that is being operated from another app you may have to do something with API.

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47
    Yeah, the comm control limits me to have my app open the ports, and the number of ports that i can use with that control is 16 (or 32 I don't remember). I need to check the ports of up to 256 com ports. The actual problem is that I can get most of the data from the registry of Win NT based systems, but I couldn't find out where the information is in Win98 systems. Anyone know if there's any API's that I could use?
    Dave

  4. #4
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149
    Check out information conecerning this API

    VB Code:
    1. Private Declare Function ConfigurePort Lib "winspool.drv" Alias "ConfigurePortA" (ByVal pName As String, ByVal hwnd As Long, ByVal pPortName As String) As Long

    Maybe this will help

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47
    That API only seems to config printer ports. But thanks anyways
    Dave

  6. #6
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose, Ca. - USA
    Posts
    302
    I found a quick comm port tutorial, but it's not all that usefull:
    http://www.vbrad.com/


    I also found a good listing of resources, have way down the page are bunch of software links. maybe one will help you.
    http://www.lvr.com/serport.htm


    I think the best solution for you would be to find a tutorial concerning the underlying api, after all the control is just a wrapper. I use to have a good link for that, but I can't seem to find it.

  7. #7
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762
    I would sugest using Inpout32.dll available here: http://www.logix4u.cjb.net/ and access the serial port registers directly. If needed, I may be able to supply more links about this.
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width