Lisp HUG Maillist Archive

COM::CHECK-INTERFACE-ADD-REF

Hi to those working with the COM package,

I've been using LW COM/Automation to interact with AutoCAD. All seemed to be working fine, till I hit this "show stopper". 

DARF 52 > ;; The symbol pointing to the com-interface:  obj
obj
#<COM interface I-ACAD-BLOCK-REFERENCE-2 = 001BE744>

DARF 53 > ;; There is a method called GetAttributes
(gethash "GetAttributes" (slot-value (com::get-i-dispatch-interface-desc obj) 'com::method-specs))
#S(COM::METHOD-SPEC-ENTRY :NAME "GetAttributes" :ID 9 :INVKIND 1 :IDL-FLAGS #())
T

DARF 54 > ;; Call it:
(invoke-dispatch-method obj "GetAttributes")

Error: The call (#<Function COM::CHECK-INTERFACE-ADD-REF 21888742> #<COM interface I-DISPATCH = 001D3124>) does not match definition (#<Function COM::CHECK-INTERFACE-ADD-REF 21888742> COM::INTERFACE-POINTER COM::BYREF ADD-REF).

<<list of restarts>>


If I understand this correctly, internally the LW call to COM::CHECK-INTERFACE-ADD-REF is botched? I get the same outcome using
(call-dispatch-method). Not knowing if the *bug* is in my use of LW, or LW itself, thought I'd better post this first.

Thanks,
Brian C.


Re: COM::CHECK-INTERFACE-ADD-REF

For general interest, LispWorks support confirms there was an error,
with the addition: "It is worth noting that the error occurs for methods that return an array of
interface pointers.  With the bug fixed, LispWorks will convert this array
into a Lisp array of COM interface pointer objects and you will need to call
COM:RELEASE on each of these pointers when you have finished with them."

My small contribution to making LispWorks perfect.  :^)

BC


Updated at: 2020-12-10 08:44 UTC