.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Passing AutoCAD Object to DLL

1 REPLY 1
Reply
Message 1 of 2
Anonymous
199 Views, 1 Reply

Passing AutoCAD Object to DLL

When calling a DLL function from AutoCAD 2002 Visual Lisp I use the
following code and everything works fine.

(setq $acad (vlax-get-acad-object))
(setq vbstrcls (vla-GetInterfaceObject $acad "TestProj2.Class1"))
(vlax-invoke-method vbstrcls "DrawObject" $acad (car mod_ins) (cadr
mod_ins))

If I call the same routine from AutoCAD 2006 I get the following error when
the last line is evaluated:

Program error - Automation Error. QueryInterface for interface
AutoCAD.IAcadApplication failed.

Does anyone know why this is and how to fix it?

Dale
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Oops, I still had the 2000 library referenced in the DLL. Sorry.

"Dale Levesque" wrote in message
news:4950422@discussion.autodesk.com...
When calling a DLL function from AutoCAD 2002 Visual Lisp I use the
following code and everything works fine.

(setq $acad (vlax-get-acad-object))
(setq vbstrcls (vla-GetInterfaceObject $acad "TestProj2.Class1"))
(vlax-invoke-method vbstrcls "DrawObject" $acad (car mod_ins) (cadr
mod_ins))

If I call the same routine from AutoCAD 2006 I get the following error when
the last line is evaluated:

Program error - Automation Error. QueryInterface for interface
AutoCAD.IAcadApplication failed.

Does anyone know why this is and how to fix it?

Dale

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost