Solved

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

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Header of docx file 17 131
Question to Pivot table 1 67
.NET tools for adding thread safety to a web app? 3 56
C++ Code Issue 4 38
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

733 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