TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: masoud_123 on November 21, 2014, 04:51:45 AM
-
Hi
I have a .dll activex written in VB6, it needs a sting as argument (assuming a path)
The project name is: prjName
The Class name is: prjClass
The function name is: FuncName
The function parameter name is: FuncParameter
how can load it from vlisp?
I've registered .dll and used this code but doesn't work! :-(
(defun load-dll (FuncParameter )
(vl-load-com)
(setq acadApp (vlax-get-acad-object))
(setq vbApp (vla-GetInterfaceObject acadApp "prjName.prjClass"))
(if
(not vbApp)
(princ "\nError loading Activex DLL")
)
(vlax-invoke vbApp "FuncName" FuncParameter )
)
error: Automation Error. Problem in loading application
-
Based on the way the code looks your .dll is within a directory scanned by ACAD?
-
Based on the way the code looks your .dll is within a directory scanned by ACAD?
No,because it's registered. Is it important to be in a scanned directory of ACAD?
-
http://www.cadtutor.net/forum/showthread.php?83028-Add-a-.DLL-Command-into-your-Startup-Lisp-Routine
Based on Lee using findfile, I'd assume so.
-
http://www.cadtutor.net/forum/showthread.php?83028-Add-a-.DLL-Command-into-your-Startup-Lisp-Routine
Based on Lee using findfile, I'd assume so.
Unfortunately, it doesn't work... :-( :-(
Any suggestion?
-
http://www.cadtutor.net/forum/showthread.php?83028-Add-a-.DLL-Command-into-your-Startup-Lisp-Routine
Based on Lee using findfile, I'd assume so.
Unfortunately, it doesn't work... :-( :-(
Any suggestion?
Does the assembly (i.e., .DLL) reside within Support File Search Path (SFSP)?
If not, did you supply the full file path to same within the NETLOAD call?
Does the assembly reside in a local folder, or on a network folder?
If a network folder, have you enabled LoadFromRemoteSources (http://through-the-interface.typepad.com/through_the_interface/2011/07/loading-blocked-and-network-hosted-assemblies-with-net-4.html) XmlAttribute in Acad.exe.Config?
-
http://www.cadtutor.net/forum/showthread.php?83028-Add-a-.DLL-Command-into-your-Startup-Lisp-Routine
Based on Lee using findfile, I'd assume so.
Unfortunately, it doesn't work... :-( :-(
Any suggestion?
Does the assembly (i.e., .DLL) reside within Support File Search Path (SFSP)?
If not, did you supply the full file path to same within the NETLOAD call?
Does the assembly reside in a local folder, or on a network folder?
If a network folder, have you enabled LoadFromRemoteSources (http://through-the-interface.typepad.com/through_the_interface/2011/07/loading-blocked-and-network-hosted-assemblies-with-net-4.html) XmlAttribute in Acad.exe.Config?
.dll file resides support search path
I am not using netload because the function needs and argument (a string)
.dll file is located in local folder
-
http://www.cadtutor.net/forum/showthread.php?83028-Add-a-.DLL-Command-into-your-Startup-Lisp-Routine
Based on Lee using findfile, I'd assume so.
Unfortunately, it doesn't work... :-( :-(
Any suggestion?
Does the assembly (i.e., .DLL) reside within Support File Search Path (SFSP)?
If not, did you supply the full file path to same within the NETLOAD call?
Does the assembly reside in a local folder, or on a network folder?
If a network folder, have you enabled LoadFromRemoteSources (http://through-the-interface.typepad.com/through_the_interface/2011/07/loading-blocked-and-network-hosted-assemblies-with-net-4.html) XmlAttribute in Acad.exe.Config?
.dll file resides support search path
I am not using netload because the function needs and argument (a string)
.dll file is located in local folder
Disclosure: I only code in LISP & .NET; skipped VBA altogether.
AFAIK, a .DLL does not need a parameter to LOAD... However, it may require an argument to evaluate a Method/Function, no?
Did you compile for correct environment (x86, x64)?
-
http://www.cadtutor.net/forum/showthread.php?83028-Add-a-.DLL-Command-into-your-Startup-Lisp-Routine
Based on Lee using findfile, I'd assume so.
Unfortunately, it doesn't work... :-( :-(
Any suggestion?
Does the assembly (i.e., .DLL) reside within Support File Search Path (SFSP)?
If not, did you supply the full file path to same within the NETLOAD call?
Does the assembly reside in a local folder, or on a network folder?
If a network folder, have you enabled LoadFromRemoteSources (http://through-the-interface.typepad.com/through_the_interface/2011/07/loading-blocked-and-network-hosted-assemblies-with-net-4.html) XmlAttribute in Acad.exe.Config?
.dll file resides support search path
I am not using netload because the function needs and argument (a string)
.dll file is located in local folder
Disclosure: I only code in LISP & .NET; skipped VBA altogether.
AFAIK, a .DLL does not need a parameter to LOAD... However, it may require an argument to evaluate a Method/Function, no?
Did you compile for correct environment (x86, x64)?
Yes, it needs a path as an argument to evaluate something,
and it's compiled for x86 environment.
-
Yes, it needs a path as an argument to evaluate something,
and it's compiled for x86 environment.
You need to load the assembly before you can evaluate a function that the assembly defines.
What version of AutoCAD are you compiling for, and is it x86, or x64?
Did you update all of your references prior to compiling the assembly?
-
Yes, it needs a path as an argument to evaluate something,
and it's compiled for x86 environment.
You need to load the assembly before you can evaluate a function that the assembly defines.
What version of AutoCAD are you compiling for, and is it x86, or x64?
Did you update all of your references prior to compiling the assembly?
Im using autocad 2013 64 bit. and updated all refrences before compliling.
-
... it's compiled for x86 environment.
If you're using 64-bit AutoCAD, then your DLL needs to be 64-bit as well.
-
1+
This is but one of the many advantages of .NET over VBA, in that one can simply compile a non-environment-dependent assembly using 'Any CPU', and the resultant assembly can be loaded into both x86 and x64 versions.