Results 1 to 3 of 3

Thread: Fix the VLISP/ActiveX object-management bug

  1. #1
    AUGI Addict sinc's Avatar
    Join Date
    2004-02
    Location
    Colorado
    Posts
    1,986
    Login to Give a bone
    0

    Default Fix the VLISP/ActiveX object-management bug

    There is a bug (probably in the VLISP/ActiveX bridging mechanism) that causes Autocad to become unstable if VLA-objects accessed through the ActiveX object model are not explicitly released. This means you can't use inline calls to Autocad entities in code like the following:

    (vla-get-name (vla-item (vla-get-documents (vlax-get-acad-object)) myIndex))

    This line of code does not maintain the reference to the various objects returned, so they cannot be explicitly released later. This may possibly be fixed by strategically-placed explicit calls to the garbage collector, but if so, this proceedure should be clearly documented.

    At the very least, this bug should be noted in the documentation, in VERY CLEAR fashion, since it violates a central tenet of Lisp (that objects are garbage-collected, and do not need to be explicitly released). This bug has apparently existed ever since the introduction of VLISP, and it still isn't documented. I've found a lot of tales of woe caused by this bug...
    Last edited by sinc; 2004-09-18 at 04:37 PM.

  2. #2
    AUGI Addict sinc's Avatar
    Join Date
    2004-02
    Location
    Colorado
    Posts
    1,986
    Login to Give a bone
    0

    Default Re: Fix the VLISP/ActiveX object-management bug

    Oops, I should probably post a better example. I think the problem only crops up when using interface objects, as in the following example:

    (setq curSurfName (vll-get-currentSurface (vll-get-surfaces (vll-get-activeProject aeccApp))))

    Note the above line assumes the landauto.tlb is loaded with prefix "vll-", and aeccApp is the Civil Design application object retrived using:

    (setq aeccApp (vla-getInterfaceObject (vlax-get-acad-object) "Aecc.Application"))

    If you stay within the default vanilla-Autocad application, I don't *think* there's a problem...

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Fix the VLISP/ActiveX object-management bug

    FWIW, this is the nature of the beast when working with interfaces. Always save references to a variable so that you can release them. Also, the vertical products really should be customized using VB(A) or C++/.NET languages. LISP support is very problematic.

Similar Threads

  1. ActiveX component can't create object
    By jkp in forum VBA/COM Interop
    Replies: 3
    Last Post: 2014-11-19, 08:50 PM
  2. Run-time error '429' (ActiveX component can't create object)
    By Pwned555402908 in forum VBA/COM Interop
    Replies: 1
    Last Post: 2011-12-08, 10:05 PM
  3. Replies: 7
    Last Post: 2006-04-19, 05:42 PM
  4. Object in which space in ActiveX method !
    By rajat_bapi_mallick in forum AutoLISP
    Replies: 2
    Last Post: 2005-12-29, 09:04 AM
  5. Vlisp/ActiveX equivalent of (getvar )
    By csgohjmj in forum AutoLISP
    Replies: 1
    Last Post: 2005-04-02, 09:43 PM

Posting Permissions

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