Solved

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

Posted on 2007-04-09
4
1,224 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

777 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