Solved

Registering ATL/COM DLL object - fails with return code 0x80020009

Posted on 2003-12-08
3
2,026 Views
Last Modified: 2013-11-25

I have an ATL COM object, which also uses MFC.  I am building in VC++ 6, but when I register my object with regsvr32.exe, it fails with a return code of 0x80020009.  However, if I remove all OBJECT_ENTRY() items from the object map, all works fine.  This simply confirms something is corrupt or missing in when the object is registered.

I have verified that all dependencies are found and linked correctly.

A breakpoint is set in DllRegisterServer, which simply calls:

    return _Module.RegisterServer(TRUE);

However, I am unsure what I am trying to find to resolve this.

I am including the .rgs files in the resource for each class, and have the DECLARE_REGISTRY_RESOURCEID() macro in place in the header file.

Any pointers appreciated to help track this down.  I am skilled in MFC more than ATL, though I have written several ATL and COM objects over the years.
0
Comment
Question by:dmetzler
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
vascov earned 250 total points
ID: 9903526
Does this happen for any build ( Debug, ReleaseMinDependency, ReleaseMinSize ) ?

Here are some things to investigate:
* if this is happening only in MinDependency, add atl.dll
* Try to register your from a simple path (no spaces)  (i vaguely recall a bug in regsvr32.exe that had to do with path names)
* It's a long shot, but it might also be related with security Q190686 (http://support.microsoft.com/?kbid=190686)
* Also make sure you don't have initialization code running making use of COM before COM is initialized (global vars that make use of other objects for instance)


0
 

Author Comment

by:dmetzler
ID: 9916207
I found it - there were lines in the .RGS file that were causing this.  While I have not tracked down the specific problem, I have fixed it.  However, since you answered with good suggestions, you will get the points.

Thanks!

Don
0
 
LVL 12

Expert Comment

by:vascov
ID: 9916486
Thanks.

Glad that you nailed it!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question