Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Why is #pragma comment(lib, "atlthunk.lib") needed in source file?

Reply
Thread Tools Display Modes

Why is #pragma comment(lib, "atlthunk.lib") needed in source file?

 
 
TFS
Guest
Posts: n/a

 
      08-26-2010
I'm trying to use VC++ 2008 Express (in 32bit XP). I'm told to install WDK
7.1.0 in order to get ATL. After installing WDK and making the "build -cZ",
I added all the necessary folder paths for "Include" and "Library" in VC++
2008 Express. More exactly, I went to Tools menu > Options , then in
"Projects and Solutions" branch > "VC++ Directories" sub-branch, I added the
following paths to Include:
* C:\WinDDK\7600.16385.1\inc\atl71
* C:\WinDDK\7600.16385.1\inc\api
* C:\WinDDK\7600.16385.1\inc\mfc42
and the following to Library:
* C:\WinDDK\7600.16385.1\lib\ATL\i386

So far so good, right? Then comes the strange thing that I don't understand.

For some projects which were written in VC++ 2003, 2005 or 2008 (not
express), sometimes I have to add
#pragma comment(lib, "atlthunk.lib")
in source code file, eg in stdafx.h

I understand that this instruction tells the linker to look for atlthunk.lib
file. But why just this file in particular? You see,
C:\WinDDK\7600.16385.1\lib\ATL\i386 contains four lib files:

atl.lib, atls.lib, atlsd.lib and atlthunk.lib.

The other three lib files are loaded correctly without I need to write
something like
#pragma comment(lib, "atl.lib")

Then why does this atlthunk.lib require us to change source code? Is there
any side-effect is the project is opened in VC++ 2008 full edition again?
_______

Technical detail in case you ask why atlthunk.lib is needed:
When atlwin.h or atlcom.h is included and a certain memroy allocation
function is called, this atlthunk.lib is needed.
 
Reply With Quote
 
 
 
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      08-26-2010
WDK contains some ATL in it, no need to include it from VC++

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

"TFS" <> wrote in message newsB1D0E6D-4C6F-4CD8-858D-...
> I'm trying to use VC++ 2008 Express (in 32bit XP). I'm told to install WDK
> 7.1.0 in order to get ATL. After installing WDK and making the "build -cZ",
> I added all the necessary folder paths for "Include" and "Library" in VC++
> 2008 Express. More exactly, I went to Tools menu > Options , then in
> "Projects and Solutions" branch > "VC++ Directories" sub-branch, I added the
> following paths to Include:
> * C:\WinDDK\7600.16385.1\inc\atl71
> * C:\WinDDK\7600.16385.1\inc\api
> * C:\WinDDK\7600.16385.1\inc\mfc42
> and the following to Library:
> * C:\WinDDK\7600.16385.1\lib\ATL\i386
>
> So far so good, right? Then comes the strange thing that I don't understand.
>
> For some projects which were written in VC++ 2003, 2005 or 2008 (not
> express), sometimes I have to add
> #pragma comment(lib, "atlthunk.lib")
> in source code file, eg in stdafx.h
>
> I understand that this instruction tells the linker to look for atlthunk.lib
> file. But why just this file in particular? You see,
> C:\WinDDK\7600.16385.1\lib\ATL\i386 contains four lib files:
>
> atl.lib, atls.lib, atlsd.lib and atlthunk.lib.
>
> The other three lib files are loaded correctly without I need to write
> something like
> #pragma comment(lib, "atl.lib")
>
> Then why does this atlthunk.lib require us to change source code? Is there
> any side-effect is the project is opened in VC++ 2008 full edition again?
> _______
>
> Technical detail in case you ask why atlthunk.lib is needed:
> When atlwin.h or atlcom.h is included and a certain memroy allocation
> function is called, this atlthunk.lib is needed.

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add-Ons "run without permission." OREALLY Internet Explorer 2 01-19-2010 06:09 AM
Error number: 0x8024D007 Manel Windows Update 13 11-16-2009 03:23 PM
.zip error message - Source Path Too Long - How do I unzip my file Jill Windows Vista File Management 4 03-29-2008 11:33 PM
cloning laptop sata harddrive vista premium Mark Ryan Windows Vista Hardware 5 04-26-2007 06:44 PM
mmc.exe error, cannot run. olouvignes Windows Vista Installation 4 04-18-2007 02:40 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59