Visual Basic Customization

Visual Basic Customization

Reply
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 1 of 8 (140 Views)
Accepted Solution

Vista & DLL files

140 Views, 7 Replies
02-27-2012 02:44 AM

Hi.

 

I have an application with code compiled in a dll file. I call commands in the dll using a lisp file which calls a macro which calls the command in the dll.

This all works fine with Windows XP but not on vista. The macro can't seem to call the dll.

 

The dll file is registerd and I can find it in the registry editor. Can anyone suggest why it's not working with Vista?

 

Command Line:

Command: tcat
_-vbarun
Macro name: DLLTCAT Execution error
Command: nil


 

Lisp:

(defun C:TCAT ()
(command "_-vbarun" "DLLTCAT")
)

 

Macro:

Sub DLLTCAT()
Set Mydll = ThisDrawing.Application.GetInterfaceObject("Profile.Main")
Mydll .DLLTCAT
End Sub

 

 

Hi,

 

>> Is it possible to get the 32 bit version working on the 64 bit machines

If there exists an 64bit-version of your type of AutoCAD you won't get the 32bit-version running on 64bit-OS.

 

E.g. for Civil3D (vertical product based on AutoCAD) there was a release 2010 that didn't support 64bit ==> that version is installable in 64bit OS and runs in 32bit-mode. But only because there is no 64bit-version of Civil3D2010.

 

Sorry, - alfred -

*Expert Elite*
Alfred.NESWADBA
Posts: 9,217
Registered: ‎06-29-2007
Message 2 of 8 (139 Views)

Re: Vista & DLL files

02-27-2012 02:50 AM in reply to: SRSDS

Hi,

 

are you running Vista in 64bit-mode ... and you DLL previously was designed for/compiled to 32bit?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 3 of 8 (138 Views)

Re: Vista & DLL files

02-27-2012 03:15 AM in reply to: Alfred.NESWADBA

Hi Alfred,

 

Thankyou..that explains things. It looks like I need to convert my app from VB6 to .net.

Is it possible to get the 32 bit version working on the 64 bit machines until I can make the conversion? Do I need to use XP mode?

 

 

 

*Expert Elite*
Alfred.NESWADBA
Posts: 9,217
Registered: ‎06-29-2007
Message 4 of 8 (135 Views)

Re: Vista & DLL files

02-27-2012 03:22 AM in reply to: SRSDS

Hi,

 

>> Is it possible to get the 32 bit version working on the 64 bit machines

If there exists an 64bit-version of your type of AutoCAD you won't get the 32bit-version running on 64bit-OS.

 

E.g. for Civil3D (vertical product based on AutoCAD) there was a release 2010 that didn't support 64bit ==> that version is installable in 64bit OS and runs in 32bit-mode. But only because there is no 64bit-version of Civil3D2010.

 

Sorry, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 5 of 8 (134 Views)

Re: Vista & DLL files

02-27-2012 03:28 AM in reply to: SRSDS

At least I know the problem. I've already done a fair amount of the conversion so it looks like I need to get back to finishing it off.

Thanks again!! 

 

Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 6 of 8 (126 Views)

Re: Vista & DLL files

02-27-2012 04:45 AM in reply to: SRSDS

Alfred,

 

I've just been told that the computer is actually 32 Bit Vista.

Is there anything I can do to get the program running.

I tried setting the compatibility of acad.exe to XP mode. It didn't seem to help.

*Expert Elite*
Alfred.NESWADBA
Posts: 9,217
Registered: ‎06-29-2007
Message 7 of 8 (121 Views)

Re: Vista & DLL files

02-27-2012 05:39 AM in reply to: SRSDS

Hi,

 

ok, in that case I would start with a small EXE and try to add your DLL (that would propably be an ActiveX-DLL) to the references. If that works you got obstacle one.

Next in your sample-EXE try to GetObject to your ActiveX-object ==> does that work (obstacle two) you can then try to call a sub or a function within your DLL.

 

If all the above job's are working then you have proofed that your computer can handle the ActiveX-DLL. Now the next step is to play with the AutoCAD-environment. Either you have AutoCAD-based references in your DLL that may not be compatible to the AutoCAD-version you are running or there is something with your LISP-to-VBA-to-DLL aproach. You would be able to do the ActiveX-access directly in LISP, you don't need VBA for that. Check for vlax-get-object.

 

Or (just the next idea) you have not installed the VBA-runtime?

 

HTH, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 8 of 8 (115 Views)

Re: Vista & DLL files

02-27-2012 10:43 AM in reply to: Alfred.NESWADBA

I didn't know how to test by creating an .exe so I tried the lisp to dll direct route.

 

(defun C:TCAT ()
(setq Test (vlax-create-object "mydll.Main"))
(setq answer(vlax-invoke-method Test 'DLLTCAT))
)

 

That doesn't seem to work. And I did have the VBA-runtime installed.

 

Looks like I need to change it to .net.

Thanks again for your help here!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.