AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem in loading application

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
1548 Views, 8 Replies

Problem in loading application

I get the message "Problem in loading application" when I run the following code (copied straight from the help
file).
It's occurs in AutoCad Map 2008.

Public m_Map As AcadMap
Public m_MapProject As Project

Private Sub Class_Initialize()
Set m_Map = ThisDrawing.Application. _
GetInterfaceObject("AutoCADMap.Application.2")
If m_Map Is Nothing Then
MsgBox "Unable to create AutoCADMap.Application Automation server."
End
End If

Set m_MapProject = m_Map.Projects(ThisDrawing)
If m_MapProject Is Nothing Then
MsgBox "Unable to get active map project."
End
End If
End Sub

Any help?

I'm Trying in AutoCad Map 2008

-lymajunior
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Remove the 2 after AutoCADMap.Applicatin. You don't need the ProgID with 2008.
Message 3 of 9
Anonymous
in reply to: Anonymous

Hello mapworks,
But when I remove the 2 after AutoCADMap.Application, the error that returns now is type mismatch.I'm trying everything but nothing works.Do you know what I can do?
See the attached file with the erros.
Thanks
lymajunior
Message 4 of 9
Anonymous
in reply to: Anonymous

Go into Tools->References and make sure your Autodesk libraries are all pointing to 2008 especially AmVbApi.tlb which should be in \Program Files\AutoCAD MAP 3D 2008.
Message 5 of 9
Anonymous
in reply to: Anonymous

I get "Problem in Loading Application" with AutoCAD 3D Map 2011 on

AcadMap = acad.GetInterfaceObject("AutoCADMap.Application")

What should i do to fix this?

Message 6 of 9
norman.yuan
in reply to: Anonymous

I have no problem with this code with AutoCAD Map 2011 in one computer and AutoCAD Map 2012 in another computer, both are Win7 64-bit:

 

Public Sub MapTest()

    Dim app As AutocadMAP.AcadMap
    Dim proj As AutocadMAP.Project

    Set app = Application.GetInterfaceObject("AutoCADMap.Application")
    Set proj = app.Projects(ThisDrawing)

    MsgBox "Projection: " & proj.CurrentProjection

End Sub

 Are you sure you have set reference to AcMapVbaApi.tlb?

Norman Yuan

Drive CAD With Code

EESignature

Message 7 of 9
Anonymous
in reply to: norman.yuan

i'm designing a 64 bit VB.NET for win7 code on a 32 bit machine XP machine.

I did not have the reference to AcMapVbAbi.tlb, should i use this one or AcMapVbAbi.dll?

and mostly i want to get the alliases after

 

acad.GetInterfaceObject("AutocCADMap.Application")

Message 8 of 9
norman.yuan
in reply to: Anonymous

So, you are not doing VBA, then.

 

I do understand what does this mean:

 

<quote>

i'm designing a 64 bit VB.NET for win7 code on a 32 bit machine XP machine.

</quote>

 

What type of application you are doing, for which version of AutoCAD? If you are doing AutoCAD .NET API adding, there is not need to use Map's COM API (for pre AutoCAD 2014 version, you cannot use 32-bit COM API in your .NET addin.

 

IMO, if you use .NET for programming, you do not need Map's COM API at all.

Norman Yuan

Drive CAD With Code

EESignature

Message 9 of 9
Anonymous
in reply to: norman.yuan

correct, VBA was said to be going away, so i'm converting VBA code to VB.NET to get it to work with a 64bit machine.

The line of code works now When i added the reference to AcMapVbAbi.tlb in Visual Studio 2010.

AutoCAD 3d map 2011

im not sure which references i do not need ? Map's COM API ?

anyways thanks for your help that seems to work so far at least it pasted that line of code

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

Post to forums  

Autodesk Design & Make Report

”Boost