VB6 error initializing Acad

VB6 error initializing Acad

Anonymous
Not applicable
271 Views
1 Reply
Message 1 of 2

VB6 error initializing Acad

Anonymous
Not applicable
Why do the following lines of code return an error in VB6 when I use them as
stated in the help files? By the way, I am using LDD2i.

Dim appAcad as AcadApplication
Dim objAcadMap as AcadMap

Set appAcad = GetObject(, "Acad.Application")
set objAcadMap as appAcad.GetInterfaceObject("AutoCADMap.Application")
0 Likes
272 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
"Tim Dear" wrote in message
news:3D995E23A3B89B9446943D81C70912F3@in.WebX.maYIadrTaRb...
> Why do the following lines of code return an error in VB6 when I use them
as
> stated in the help files? By the way, I am using LDD2i.
>
> Dim appAcad as AcadApplication
> Dim objAcadMap as AcadMap
>
> Set appAcad = GetObject(, "Acad.Application")
> set objAcadMap as appAcad.GetInterfaceObject("AutoCADMap.Application")
>

Hello Tim,

It looks like your running into the early binding
issue in the Map Automation Library.

Unfortunately, the Map Library only supports
early binding from within Acad VBA. For VB
you must declare all of the Map objects using
late binding...

In other words, declare all Map objects as Object.

Dim objAcadMap as Object

Cheers-

rdh.
0 Likes