Using Mscomm library with Autolisp

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

  1. Bruno

    Bruno Guest

    Hello,

    Has anyone tried to use the mscomm library with autolisp?

    This is what I got until now:

    (defun loadmscomm ()
    (vlax-import-type-library
    :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
    "MSCommLib.MSComm")

    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.

    Thanks,

    Bruno
     
    Bruno, May 11, 2004
    #1
  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]
    system.
     
    Rick Francken, May 11, 2004
    #2
  3. Jimmy Bergmark, May 11, 2004
    #3
  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
     
    Bruno, May 17, 2004
    #4
  5. Some links that might be useful:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;107991
    http://www.google.com/search?q=mscomm+license+vb

    --
    Best Regards, Jimmy Bergmark
    CAD and Database Developer Manager at www.pharmadule-emtunga.com
    Take a look at
    JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport
    SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm
    or download some freeware at www.jtbworld.com
    More on AutoCAD 2005;
    www.jtbworld.com/autocad2005.htm
     
    Jimmy Bergmark, May 17, 2004
    #5
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.