Author Topic: Lauching Autocad from a VB exe? No luck...  (Read 19897 times)

0 Members and 1 Guest are viewing this topic.

Dnereb

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #30 on: April 27, 2006, 05:15:08 PM »
If it's just in one function couldn't you make it Local or Static?
If this fiunction only will be used when acad 61.2 is present you don't have to worrie, although i still think you should late bind. The way I do "it" this way:
I write the initial code early bound. (intellisense is a blessing) but on each line I early bind I make a remark 'As Object
So is I wan't to compile I save a copy first and sears for 'As Object and alter these lines to late bind.
and compile .

You seem to wonder why it make a diffrence...well how could a variable that's public not be proccessed if your code can adress it from everywhere...


havano

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #31 on: April 27, 2006, 05:31:10 PM »
I haven't got a clue...

Dnereb

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #32 on: April 27, 2006, 05:41:40 PM »
It is preproccessed to assign the propper object types to all Public type's amongst many other things....
This means
Public My_acad as AcadApplication
is assigned a V-table (a definition of how the object structure is) but the pre compiler will give an error because this object definition is not availeble on a machine without Acad 16.2 installed.... hence the error.

If a variable is local the v-table wil be assigned a the moment the code starts the function.
I know this is pretty technical but that's a coding hazzard you can not avoid   :roll:

havano

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #33 on: April 27, 2006, 06:02:38 PM »
But that's exactly my point: Acad 16.2 IS installed.

Draftek

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #34 on: April 28, 2006, 08:14:22 AM »
You might try a 'repair registry' on the problem autocad installation.


Dnereb

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #35 on: April 28, 2006, 08:21:08 AM »
But that's exactly my point: Acad 16.2 IS installed.

He has either an LT version installed or another version.

Hold on I'll make a .exe to read the acad registry...should have something similar hanging around somewhere.

havano

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #36 on: April 28, 2006, 08:52:27 AM »
The customer has Acad 2006 full version AND Acad 2006 LT AND Acad R14 on his system...

Draftek

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #37 on: April 28, 2006, 08:56:12 AM »
First of all, you don't need the minor version .2 I don't believe.

Second, if they installed LT after the full version you could have a registry problem and the repair registry of autocad will clear that up.

I've had problems with autodesk software Inventor, Autocad, ADT, Mechanical, etc. Messing the registry up of earlier installs. Microsoft products may do the same thing.

Just a few years ago, If we had a tech support call, one of the first things asked was "Did you install MS Office after you installed autocad?"

Dnereb

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #38 on: April 28, 2006, 09:32:12 AM »
just to be sure run this at your customer.
it will count and read all versions still having keys in his register.


havano

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #39 on: April 28, 2006, 09:34:27 AM »
Meantime, I mailed the customer a new version of the test executable, with private object declaration and late binding. Also I advised him -regardless of the test's outcome- to get rid of Acad LT and try the earlier test programs again, because even with this tiny test program I notice a drop in speed, probably because of the late binding.

Great little program, Dnereb! I'll wait for the test results (don't want to swamp the customer with e-mails, options and assignments) and then send him the version detector. Thanks!
« Last Edit: April 29, 2006, 06:47:12 PM by havano »

Dnereb

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #40 on: April 29, 2006, 12:42:48 PM »
reading up on com and marshalling...I found that your error also could be created if your customer moved or renamed
the autocad directory or a folder it's part of. this way the register is pointing at wrong place for the information to create the object.

havano

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #41 on: April 29, 2006, 06:46:19 PM »
Since the customer has 3 versions of Autocad on his system, chances are the Autocad 2006 full version is not in the default directory. However I don't think he has changed the directory name after the installation.

Yesterday I finally bought myself a notebook, so I will now be able to go to the customer and do some trial-and-error coding on the spot.

Dnereb

  • Guest
Re: Lauching Autocad from a VB exe? No luck...
« Reply #42 on: April 30, 2006, 04:45:42 AM »
Just be sure to ask if he did before you blow your brains. :-)