Click here to Skip to main content
15,898,729 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: invoke non-static function using :: Pin
Rajkumar R22-Feb-08 23:23
Rajkumar R22-Feb-08 23:23 
GeneralRe: invoke non-static function using :: Pin
George_George22-Feb-08 23:27
George_George22-Feb-08 23:27 
GeneralRe: invoke non-static function using :: Pin
Rajkumar R22-Feb-08 23:35
Rajkumar R22-Feb-08 23:35 
GeneralRe: invoke non-static function using :: Pin
George_George22-Feb-08 23:48
George_George22-Feb-08 23:48 
GeneralProblem when implement a class derived from CListCtrl which display image only (i.e. no label) [Updated] [modified] Pin
followait22-Feb-08 21:58
followait22-Feb-08 21:58 
QuestionHow can I browse filesystem in windows mobile device with SHBrowseForFolder Pin
fujoey22-Feb-08 20:46
fujoey22-Feb-08 20:46 
GeneralDLL function address Pin
George_George22-Feb-08 20:32
George_George22-Feb-08 20:32 
GeneralRe: DLL function address Pin
Stephen Hewitt24-Feb-08 17:25
Stephen Hewitt24-Feb-08 17:25 
George_George wrote:
1.Inside DLL

For the DLL itself, in its build process, it has to decide the address of each function in the result binary file (.dll), right? I think each exported function in the dll biinary file has a definite absolute address, which is based on the default load base address of the DLL, right?


This is correct. The DLL also contains relocation information which contains all the data needed by the loader relocate the DLL if needed.

George_George wrote:
2. Inside EXE

For the EXE, which utilizes the DLL, since there may be DLL rebase, which changes the base load address of the DLL into EXE process space, the address of the exported function of the DLL is not known until EXE load time and the final rebased address of the exported function of the DLL is put into the IAT of EXE.
In other words, the same function of the DLL, may have different address in different EXEs, which loads the DLL into related process space of EXE.
So, all the places where invokes the dllexported function, will use a function pointer to point to the IAT entry of the related dllexported function to form a indirection level function call. No address of DLL exported function is known and written to the EXE binary until load time address fix-up.


This is mostly correct. A minor point:
 When you say "DLL rebase" it looks like you mean "relocate". "Relocation" is the when the loader changes the address of a DLL because the address is already taken. "Rebase"ing is similar but is not performed by the loader at runtime but by a tool which alters the actual executable.

Steve

GeneralRe: DLL function address Pin
George_George24-Feb-08 17:55
George_George24-Feb-08 17:55 
QuestionGdiplus Text problem Pin
trioum22-Feb-08 20:01
trioum22-Feb-08 20:01 
AnswerRe: Gdiplus Text problem Pin
Rajkumar R22-Feb-08 22:25
Rajkumar R22-Feb-08 22:25 
GeneralRe: Gdiplus Text problem Pin
trioum22-Feb-08 23:27
trioum22-Feb-08 23:27 
AnswerRe: Gdiplus Text problem Pin
Rajkumar R23-Feb-08 1:41
Rajkumar R23-Feb-08 1:41 
Generalunresolved external symbol _main referenced in function _mainCRTStartup Pin
Don Box22-Feb-08 19:53
Don Box22-Feb-08 19:53 
GeneralRe: unresolved external symbol _main referenced in function _mainCRTStartup Pin
CPallini22-Feb-08 22:26
mveCPallini22-Feb-08 22:26 
QuestionRe: unresolved external symbol _main referenced in function _mainCRTStartup Pin
Rajkumar R22-Feb-08 22:27
Rajkumar R22-Feb-08 22:27 
QuestionHow to Configure the Matlab Add-in for Visual Studio 6 to work within MSVisual C++. Pin
johnalek22-Feb-08 19:44
johnalek22-Feb-08 19:44 
AnswerRe: How to Configure the Matlab Add-in for Visual Studio 6 to work within MSVisual C++. Pin
Rajkumar R22-Feb-08 21:37
Rajkumar R22-Feb-08 21:37 
GeneralGINA using finger print Pin
MozhdehQeraati22-Feb-08 18:41
MozhdehQeraati22-Feb-08 18:41 
QuestionNetwork IP Pin
mirtu22-Feb-08 18:25
mirtu22-Feb-08 18:25 
Generalextracting icon from exe or DLL Pin
act_x22-Feb-08 15:14
act_x22-Feb-08 15:14 
GeneralRe: extracting icon from exe or DLL Pin
markt22-Feb-08 16:09
markt22-Feb-08 16:09 
GeneralRe: extracting icon from exe or DLL Pin
User 238229222-Feb-08 20:18
User 238229222-Feb-08 20:18 
QuestionSaving string: fixed size array or pointer? Pin
Omegga22-Feb-08 11:40
Omegga22-Feb-08 11:40 
AnswerRe: Saving string: fixed size array or pointer? Pin
Mark Salsbery22-Feb-08 12:19
Mark Salsbery22-Feb-08 12:19 

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.