Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-04-09
4
Medium Priority
?
1,283 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:Al fa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Deepu Abraham
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:Al fa
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:
Al fa 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

609 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