Solved

Regsistering ATL (regsvr32) Problem: CAtlDllModuleT and DllRegisterServer (atlbase.h) in VS2003 versus VS2005

Posted on 2007-04-09
4
1,205 Views
Last Modified: 2013-12-14
Hi,

I make a new "ATL Project" and add an "ATL Simple Object"  to it using VS2003. I choose options so that it is an attributed object, never aggregates and supports dual interface and do not provide support for COM 1.0. This will generates a .dll  file.

When I use regsvr32.exe to register it, this tools returns without any error but it really does not write the AppID in the registry (the contents of the .rgs file does not seem to be processed).

But when I open this project in VS2005 and build it there without any modification (except that obviously solution is converted to V8.0), regsvr32 returns successfully again but the registry items are now added correctly under the AppID.

As you now the attributed dll objects  of ATL projects use default implementation for DllMain, DllRegisterServer, DllUnRegisterServer, DllCanUnloadNow, and DllGetClassObject using the "module" attribute in class implementation file (CAtlDllModuleT base class):
http://msdn2.microsoft.com/en-us/library/fs2z0f72(VS.71).aspx

Any Ideas of what is the difference between these two cases. Or is there any known bug regarding ATL projects in VS2003. And how can we overcome this problem?
0
Comment
Question by:Ali Fakoor
  • 2
4 Comments
 
LVL 11

Expert Comment

by:DeepuAbrahamK
ID: 18874947
Can you try using depends.exe and see all the depended dll's are there in both the versions of exe/dll?

0
 
LVL 5

Author Comment

by:Ali Fakoor
ID: 18875095
The problematic dll has dependency to "SHLWAPI.DLL" in addition to that of the working one.

 Obviously the problematic one depends on "MSVCR71D.DLL" (since built with VS2003) and the working one depends on "MSVCR80D.DLL" (since built with CS2005)

Many Thanks,
Ali.
0
 
LVL 5

Accepted Solution

by:
Ali Fakoor earned 0 total points
ID: 18876329
OK I could solved my problem :)

The problem was originating from expandable attributed code.
if you assign /FX to compiler switch of your attributed module, you see that DECLARE_REGISTRY_APPID_RESOURCEID is injected in VS2005 but not VS2003. I consider it kind of a BUG in VS2003.

Thanks for your help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
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.

706 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

17 Experts available now in Live!

Get 1:1 Help Now