vl & dll

Discussion in 'AutoCAD' started by Barbarossa, Jun 12, 2004.

  1. Barbarossa

    Barbarossa Guest

    I have a dll file with few classes; and I want to call one of them from my
    AutoCAD vlisp interface (I have no problem calling my dll file from other
    environment). Ok, the dll file called "XX.dll" and my class called "YY". It
    has no properties and 1 method with 5 arguments. I call from AutoCAD as:
    (setq A (vlax-create-object "XX.YY")) and vlisp returns the object ID,
    something like #<VLA-OBJECT _YY 0016c3c8>. Then, I stuck with number of
    unsuccessful attempts to call it properly. The method I mentioned has 5
    arguments from which last two arguments are optional. Types are INTEGER,
    STRING, ByRef STRING, INTEGER, STRING respectively and return value is
    boolean. Can someone show me how to make this work?

    Thanks,
     
    Barbarossa, Jun 12, 2004
    #1
  2. Barbarossa

    SpeedCAD Guest

    Hi...

    You must declare five public variables, witch they are passed to method. This variables you must set values from vlisp with vlax-put-property.

    (setq A (vlax-create-object "XX.YY"))
    (vlax-put-property A 'vbVar1 2)
    (vlax-put-property A 'vbVar2 "hello")
    (vlax-put-property A 'vbVar3 "bye")
    (vlax-put-property A 'vbVar4 5)
    (vlax-put-property A 'vbVar5 "I will be back")
    (vlax-invoke-method A 'YourMethod)

    Un saludo de SpeedCAD... :)
    CHILE
    FORO: http://www.hispacad.com/foro
     
    SpeedCAD, Jun 12, 2004
    #2
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.