DLL

Discussion in 'AutoCAD' started by Sa Mite Samite, Aug 7, 2003.

  1. There is a DLL call example in AutoCAD program folder,

    "C:\Program Files\ADT2\Sample\ActiveX\ExternalCall\",

    that called from VBA project.

    I would like to see how it works within VLA project. I've tried and
    unsuccessful.

    Here is my try.



    Command: (setq MC (vlax-create-object "ExternalFunction.MyClass"))
    Initializing VBA System...#<VLA-OBJECT _MyClass 00172668>



    Command: (vlax-dump-object MC t)
    ; _MyClass: nil
    ; No properties
    ; Methods supported:
    ; CubeVolume (3)
    T



    (vlax-invoke-method MC "CubeVolume" 5.0 5.0 5.0)
    0.0





    I've tred to import methods and properties as:

    (vlax-import-type-library :tlb-filename "C:/Program
    Files/ADT2/Sample/ActiveX/ExternalCall/externalfunction.dll"
    :methods-prefix "XXX::"
    :properties-prefix "XXX-"
    :constants-prefix "XXX_"
    )
    T

    But, even though this function returns T there will be no XXX... symbol
    defined in AutoLisp

    (acad_strlsort (atoms-family 1)) symbol list



    Can somebody show a simple example of how to call this dll from VLA project?

    The "externalfunction.dll" file and accompanied source files can be found
    in:

    "<AutoCAD installed Folder>\Sample\ActiveX\ExternalCall\" folder



    Thanks,
     
    Sa Mite Samite, Aug 7, 2003
    #1
  2. Try this:

    (vlax-invoke-method MC 'CubeVolume 5.0 5.0 5.0)

    or this

    (vlax-invoke MC 'CubeVolume 5.0 5.0 5.0)
     
    Chuck Gabriel, Aug 7, 2003
    #2
  3. Sa Mite Samite

    Samvel Guest

    (vlax-invoke MC 'CubeVolume 5.0 5.0 5.0)
    Works,
    thanks
     
    Samvel, Aug 8, 2003
    #3
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.