ActiveX registering error 80040200 RRS feed

  • Question

  • Hello, everyone.

    I have a trouble with ActiveX project based on MFC.

     At 1st time I tested functionality of control via dll project. To adjust this control to ActiveX I created a new ActiveX project and added there the all files from 1st dll project. Not to add manually a numerous number of dialogs, bitmaps, menus etc, I  combined resources files into one file by copying source code from 1 file to another one and added this common file to the new project.  

    But sometimes after editing and saving a resource the next lines are removed from the recource file : 
    // Generated from the TEXTINCLUDE 3 resource.
    1 TYPELIB "xxxtlb"

    So, I need time by time add this lines to the resources file. 

    And the main problem.

    The new project compiled and linked. But registering this ActiveX Control with regsvr32 gives the next error: DllRegisterServer in xxx.ocx failed. Return code was 80040200.

    Does someone know, what this error means, why this one happens?

    Please, any advice or hints, usefull information to regards this topic.

    Thanks for advance.







    Tuesday, November 21, 2006 3:05 PM


All replies

  • Hello


    Re: ActiveX registering error 80040200


    The more appropriate place for your question is probably the MFC newsgroup:






    Friday, January 12, 2007 12:32 AM
  • Thanks everyone.

    Problem was solved.

    Friday, January 12, 2007 1:49 AM
  • Please share the solution.  And please note, Damien, that your request to ask the question somewhere else did not result in an actual answer findable via google.  It seems utterly reasonable to ask a question about why a Visual C++ ActiveX control does not register in a Visual C++ forum.  I generally prefer that people not reply to a question if their only contribution is to say you shouldn't ask the question here.  Feel free to forward the thread if you think another source may have the answer.

    My 0x80040200 occurs on a Vista OS.

    Randy Hersom

    Habilitation Software Inc.

    Thursday, January 18, 2007 4:47 PM
  • In ny case this error was caused a some strange reasone. As I told this ActiveX project was created from 2 projects: new dummy ActiveX and dll project. For a some unintelligible reason resource, tlb and idl files were not properly attached and linked to the project. After re-creating new project, adding recources and sourse code from dll project all became to work properly.

    Other similar error occured when I tested installation of this ActiveX from web. When I placed installation package to public free web site it was impossible to install this package. This cab file was corrupted with additional information emdedded into one by web hoster, like your HTML web page hosted on free web site always displays another information added by thet web hoster.

    Friday, January 19, 2007 4:53 AM
  • I met error 80040200 when I want to register my own .ocx using regsvr32 cmd in Windows Vista sp1.

    Finally I found that I have to use an elevated cmd prompt to register it. Right click on
    the cmd shortcut and pick Run as administrator.

    • Proposed as answer by plmarriott_mkm Tuesday, September 1, 2009 1:48 AM
    Tuesday, April 29, 2008 2:36 AM
  • Thanks for sharing! This solutions worked for me as well.
    Friday, July 10, 2009 7:40 PM
  • Works for me in Vista as well - Thanks ...
    Tuesday, September 1, 2009 1:48 AM
  • Hi,

    I am using Windows 7. I want to register an ActiveX Control but i am unable to do this because of absense of Admin rights. Is there any way to register an activex Control without Admin rights?

    I also try the approach suggested above: run cmd as administrator and register control but still not able to regiter control.

    Please suggest as soon as possible.

    Thanks in advance.


    Pooja Kamra

    Thursday, October 18, 2012 6:53 AM
  • Hello Pooja Kamra

    Only as a hint, the thread you are pushing is from 2009, ( --> 3 years old!). It is better creating a new one with your particular problem.

    Regarding you problem. If you have the possibility to register the ActiveX elevated (that is important! using an administrative user account is not enough) that you should not have any problem. An elevated commandline and regsvr32 should work.

    If you want the ActiveX to be registerable without using elevated access rights it should work if you register the appropriate keys in HKCU instead of HKLM registry tree.

    Thursday, October 18, 2012 8:14 AM
  • Please suggest how to register keys in HKCU ??

    Thanks in Advance.


    Pooja Kamra

    Tuesday, February 12, 2013 12:38 PM

  • Please suggest how to regiser keys in HKCU???
    • Edited by Pooja Kamra Wednesday, March 13, 2013 6:50 AM
    Wednesday, March 6, 2013 6:22 AM
  • Thank You! Give this man a MEDAL!
    Tuesday, October 29, 2019 1:23 AM