Click here to Skip to main content
15,910,411 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Possible Vista bug? Pin
DougVC18-Feb-08 11:04
DougVC18-Feb-08 11:04 
GeneralRe: Possible Vista bug? Pin
Mark Salsbery18-Feb-08 11:09
Mark Salsbery18-Feb-08 11:09 
GeneralRe: Possible Vista bug? Pin
DougVC19-Feb-08 5:26
DougVC19-Feb-08 5:26 
Generalselection tool for raster images Pin
Blaq18-Feb-08 7:31
Blaq18-Feb-08 7:31 
Generalimport library Pin
George_George18-Feb-08 2:55
George_George18-Feb-08 2:55 
GeneralRe: import library Pin
Randor 18-Feb-08 5:15
professional Randor 18-Feb-08 5:15 
GeneralRe: import library Pin
George_George18-Feb-08 15:44
George_George18-Feb-08 15:44 
GeneralRe: import library Pin
Mike Dimmick18-Feb-08 7:51
Mike Dimmick18-Feb-08 7:51 
Randor's correct in the overall behaviour but not some of the details. The compiler normally generates direct CALL instructions to call code not in the current translation unit. It leaves a direction to the linker to fill in the necessary value with the address of the corresponding symbol at link time.

The import library that you link with is what contains the JMP instructions, which look like:
MyFunc:
    JMP __imp__MyFunc
That's the 'import thunk'. There's one thunk per routine in the DLL that this is the import library for.

If you specify __declspec(dllimport), the compiler instead generates an indirect call instruction and the instruction to the linker references __imp__MyFunc rather than MyFunc. When the call is made, instead of the instruction pointer going first to the thunk, then to the function itself, it goes directly to the function.

The symbol __imp__MyFunc itself actually points to a pointer-sized value in the Import Address Table which the loader (part of the OS) writes the actual address of the function to at load time.

Also included in the import library is the full Import Address Table for the DLL, which contributes to building up the IAT in the executable itself.

For more, see http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/[^].


DoEvents: Generating unexpected recursion since 1991

GeneralRe: import library Pin
George_George18-Feb-08 15:42
George_George18-Feb-08 15:42 
QuestionHiding mouse ? Pin
kk.tvm18-Feb-08 2:17
kk.tvm18-Feb-08 2:17 
AnswerRe: Hiding mouse ? Pin
Iain Clarke, Warrior Programmer18-Feb-08 2:41
Iain Clarke, Warrior Programmer18-Feb-08 2:41 
AnswerRe: Hiding mouse ? Pin
Rajkumar R18-Feb-08 2:46
Rajkumar R18-Feb-08 2:46 
GeneralQuestion about connection with FTP server ( What wrong with my code .... ? ) [modified] Pin
Yanshof18-Feb-08 1:33
Yanshof18-Feb-08 1:33 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
Rajkumar R18-Feb-08 1:54
Rajkumar R18-Feb-08 1:54 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
Yanshof18-Feb-08 2:08
Yanshof18-Feb-08 2:08 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
David Crow18-Feb-08 2:54
David Crow18-Feb-08 2:54 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
Yanshof18-Feb-08 3:06
Yanshof18-Feb-08 3:06 
QuestionRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
David Crow18-Feb-08 3:15
David Crow18-Feb-08 3:15 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) [modified] Pin
Yanshof18-Feb-08 3:21
Yanshof18-Feb-08 3:21 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
David Crow18-Feb-08 4:43
David Crow18-Feb-08 4:43 
GeneralRe: Question about connection with FTP server ( What wrong with my code .... ? ) Pin
Yanshof18-Feb-08 4:57
Yanshof18-Feb-08 4:57 
QuestionHow can I check the exsistence of a Registry Key? Pin
J_E_D_I18-Feb-08 1:21
J_E_D_I18-Feb-08 1:21 
AnswerRe: How can I check the exsistence of a Registry Key? Pin
Rajkumar R18-Feb-08 1:26
Rajkumar R18-Feb-08 1:26 
GeneralRe: How can I check the exsistence of a Registry Key? Pin
J_E_D_I18-Feb-08 2:42
J_E_D_I18-Feb-08 2:42 
AnswerRe: How can I check the exsistence of a Registry Key? [modified] Pin
Rajkumar R18-Feb-08 2:54
Rajkumar R18-Feb-08 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.