Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Recently I was working with one of the developer who earlier designed an CDOSYS based mail component in his C++ application built using earlier Visual Studio (2005) version . After migration to VS 2008 environment, they noticed compile errors with the same code/no changes made. When I debugged further and noticed that the msado15.tlh and cdosys.tlh are not generated correctly for some reasons. When I compared the .tlh file generated by previous VS version, i noticed differences in it – as couple of keywords are missing in method definitions in the .tlh file generated by VS previous versions. That’s the reason, they noticed the compile time/linker errors.
The generation of .tlh files is affected by some codes in this project, which is compiled earlier than the import sentences. So i moved the import sentences to the very beginning of stdafx.h and used #import attribute “rename” to avoid any name collusion problems.
...
#import "c:/program files/common files/system/ado/msado15.dll" rename("ADODB","CDO") rename( "EOF", "adoEOF" )
#import <cdosys.dll>
...
+ Then i tried the changes in the code where they use msado15.dll and cdosys.dll:

After the above changes, I can successfully compile it without any errors. It helped them to move ahead.

Happy debugging!!
Comments
Anonymous
May 07, 2013
Hi Dave, Thanks you saved my years of debugging;To be honest, i was pulling my hair on this issue for couple of months. Keep the good work & thanks for posting such useful articles.Anonymous
May 10, 2013
Good one dear - i got a resolution for my migration!!