VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Old VB6 Application Not working in Acad 2012

7 REPLIES 7
Reply
Message 1 of 8
Steven.Williams79
631 Views, 7 Replies

Old VB6 Application Not working in Acad 2012

We have and old VB6 application that I tried to convert to .net but it had a ton of errors so I want to wait if I can.  In 2005 it works fine.  But we recently just upgraded to 2012.  I cannot get it to find my running acad 2012.  I use this currently. 

 

Set acApp = GetObject(, "AutoCAD.Application")

 

Should this work in 2012 or will I need to change it?

 

Steven

7 REPLIES 7
Message 2 of 8

Hi,

 

>> Set acApp = GetObject(, "AutoCAD.Application")

>> Should this work in 2012 or will I need to change it?

Yes, in principle it should work.

First please look into your VB-project-references and verify that you have changed the AutoCAD-specific references from 2005 to 2012 (to 18.2). If that is the problem, that could be changed within seconds.

But what could be much more problem, would be differences between 32bit and 64bit, are you running now 64bit-AutoCAD? If so, you have no chance (imho) to get it running, because your EXE also has to be 64bit and with VB6 you cannot compile to 64bit. In that case your next step would be to upgrade your code from VB6 to VB.NET.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 8

There shouldn't be a problem automating a 64-bit executable from a 32-bit executable (and vice versa). That's only a problem if your COM server is a DLL you're loading into your executable's process space. But the AutoCAD 32- and 64- bit Type Libraries are different, and so you do need to reference the correct one, depending on which AutoCAD you're automating.

.

Cheers,

Stephen Preston
Autodesk Developer Network
Message 4 of 8
doc_x
in reply to: StephenPreston

Ok! But if my cad version support 32bits, my vb6 applications 'll work well. There's 2011 and 2012 32 bits.

Message 5 of 8
Alfred.NESWADBA
in reply to: doc_x

Hi,

 

doc_x ==> are you skelow (thread opener)? Or is this a new issue?

 

So show your code you have (at least the snippet where the problem occurs and give us as info the line and the message of the error.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 6 of 8
doc_x
in reply to: Alfred.NESWADBA

So Sorry!

Message 7 of 8
Alfred.NESWADBA
in reply to: doc_x

Hi,

 

>> So Sorry!

nothing to worry about, at least I did not mean anything that should have to be appologized.

It's just to make it clear for us as the thread had paused for 5 months now.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 8 of 8
doc_x
in reply to: Alfred.NESWADBA

Hi Alfred !

I understand that the old vb6 application does not work in AutoCAD 2012. But building an activex (. Dll) in vb6, it works perfectly in versions 2011 and 2012, once it is in 32bit. In 64-bit will also work, however, performance falls a bit In the 2010 version works fine.

 

I hope I have clarified,

 

Doc_x

 

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

Post to forums  

Autodesk Design & Make Report

”Boost