Error when creating instance of AutoCAD.Application

Discussion in 'AutoCAD' started by James Stergar, Jun 27, 2003.

  1. I saw a fix for this somewhere way way back but can't seem to find it
    anymore. The code is pretty standard:

    **********************************************************
    On Error Resume Next

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

    If Err.number <> 0 Then

    ' An error means GetObject failed - probably AutoCAD is not already
    running
    Err.Clear
    Set acApp = CreateObject("AutoCAD.Application")

    If Err.number = 0 Then
    acApp.visible = True
    initAutoCad = True
    Else
    MsgBox ("AutoCAD not available... exiting.")
    initAutoCad = False
    End If

    Else
    initAutoCad = True
    End If
    **********************************************************

    This is really a continuation of the post regarding late binding Acad
    objects for 2000-2004 support. After late binding all Acad objects there
    was still a problem connecting to either 2002 or 2004. After uninstalling
    2002, 2004 would not work at all and I ended up with
    a "Fail to get CommCntrController" when starting AutoCAD manully. I was
    advised to run AcCleanReg2004.exe, downloaded from Autodesk's support, to
    clean any invalid registry entries before reinstalling 2004. I'm not sure
    if my two problems are related. Also, I failed to mention that GetObject
    will work if 2004 is currently running. If I use "AutoCAD.Application.16"
    GetObject won't work anymore. CreateObject will not work in either case.
    Anybody have any ideas other than throwing 2004 in the garbage and going
    back to 2002?

    Oh, one more thing, I have post concerning this problem before but can't
    seem to find a quick solution other than reinstalling AutoCAD. 2002 seems
    to be working fine but recently a user or two has had problems starting
    AutoCAD from my application. Does anybody know what the problem is and how
    to fix it other than reinstalling?

    Thanks in advance,

    James Stergar
     
    James Stergar, Jun 27, 2003
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.