Using Mscomm library with Autolisp

Discussion in 'AutoCAD' started by Bruno, May 11, 2004.

  1. Bruno

    Bruno Guest


    Has anyone tried to use the mscomm library with autolisp?

    This is what I got until now:

    (defun loadmscomm ()
    :tlb-filename "c:\\winnt\\system32\\MSCOMM32.OCX"
    :methods-prefix "comm-"
    :properties-prefix "comp-"
    :constants-prefix "comc-")

    (defun initcom ()
    (setq com1 (vlax-create-object "MSCommLib.MSComm"))
    ;; use com1
    (comp-put-commport com1 "1")
    ;; 9600 baud, no parity, 8 data, and 1 stop bit
    (comp-put-settings com1 "9600,N,8,1")

    This is the part that will not work: (vlax-create-object

    Is the string wrong? Do I need to have VB installed on the pc?

    The application I would like to implement is to couple a GPS-receiver
    to AutoCAD, now using 2004 MAP and LDT.


    Bruno, May 11, 2004
    1. Advertisements

  2. I don't see a "(vl-load-com)" call. Have you done that?

    If so, open Regedit.exe, and go to HKEY_CLASSES_ROOT. See if you can find a
    key whose name is "MSCommLib.MSComm". If the key is not found, it could
    mean that MSCOMM.OCX is not registered or present on [your / you user's]
    Rick Francken, May 11, 2004
    1. Advertisements

  3. Jimmy Bergmark, May 11, 2004
  4. Bruno

    Bruno Guest

    Thank you for your response,

    It is indeed a problem with licensing. It does not work in VB either.
    I get: Run-time error "429": ActiveX component can't create object,
    which means that there is no license key on my pc for MSComm.

    I am now searching for which product I need to buy to get the license.
    I believe VB 6 is no longer available. Is the MSComm library included
    in the .net edition? Should I buy a license for every machine where I
    want to run my application?

    Thanks again for your very helpful response,

    Bruno, May 17, 2004
  5. Some links that might be useful:;en-us;107991

    Best Regards, Jimmy Bergmark
    CAD and Database Developer Manager at
    Take a look at
    JTB FlexReport (FLEXlm report tool) -
    SmartPurger (Purges automatically) -
    or download some freeware at
    More on AutoCAD 2005;
    Jimmy Bergmark, May 17, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.