Solved

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

Posted on 2003-12-08
3
2,011 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 65
count8 challlenge 13 87
powerN  challenge 3 47
Problem to start Neon 20 54
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

760 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now