CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2000
    Posts
    3

    Automation error in VB

    I hope someone can help me. I created an activeX control which
    contains 2 forms and some routines for managing the forms. I've
    compiled the activeX control on my computer and everything works fine in
    my exe program which calls the activeX control. The problem is when I
    create a setup program and install the activeX control to another
    computer with the setup program. On the computer I installed the
    control to, when I try and access the activeX control in my vb programs
    I get "runtime error 440 - automation error". Now I can place the control on my form,
    but I can't call any functions of the control. When I do I receive the automation error message.
    Anyone know why the control would work fine on my development system,
    but give the above error after being installed on another computer with
    the setup program?
    Thanks!

    [Tim]





  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Automation error in VB

    Check that you have installed DCOM98 and MDAC on the other computer. DCOM98 must be installed manually it is not included into PDW.


    This problem happens when you use an ActiveX control in your program and the ActiveX control is not
    registered in the registry. If it works on the Development PC, it must be an incompatibillity between your
    control and the same control installed in the user PC. To fix this check which ActiveX controls you need in
    order to run your program and make sure all of them are placed in the SYSTEM folder. You should know which
    control is the one that's giving you so much trouble (it must be in the Form that crashes your program) so
    you'll have to manually register it. To do it you have two basic choices: Do it through Windows Explorer or
    through a DOS Prompt Window. If you are using the Explorer just drag and drop your
    control into REGSVR32.EXE (Both must be in the SYSTEM folder) or
    in the Dos Prompt window be sure you are in the SYSTEM folder
    and tye REGSVR32 [YourControlName].OCX After doing this you
    should see a message box saying that the registration process
    succeeded. If it fails, then you will have to dig inside the
    registry and find all the keys that references the control to
    delete them. Then you'll have to repeat the registration
    process.

    Here's another clue:
    You are refrencing an ado library that is the latest and geratest on your machine but when you try
    to package the exe PDW by dafault picks up from its own repository of redistribution components which
    normally has a version which is older.
    So what happens the PDW picks up the ADO library all right automatically based on the Reference setting in
    your project but it picks up the older version.
    If this is the case then
    For this replace the Mdac_typ.exe in the
    C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Redist with the latest Mdac_typ.exe


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Nov 2000
    Posts
    3

    Re: Automation error in VB

    Thanks for the detailed response! I finally gave up and copied the ActiveX source and forms into my main program. This fixed the problem :-). I do have another ActiveX control in the project which does transport fine to the other computer. So there must be something funky in my ActiveX control which I'm missing; but I don't have the energy now to look into it.
    Thanks again for the quick response.

    [Tim]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured