Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: debugging sprintf -VS/C++ Pin
Moak5-Aug-10 2:41
Moak5-Aug-10 2:41 
QuestionHow to create a dll wrapper Pin
VentsyV4-Aug-10 4:11
VentsyV4-Aug-10 4:11 
AnswerRe: How to create a dll wrapper Pin
Phil J Pearson4-Aug-10 4:31
Phil J Pearson4-Aug-10 4:31 
JokeRe: How to create a dll wrapper Pin
Sauro Viti4-Aug-10 4:38
professionalSauro Viti4-Aug-10 4:38 
GeneralRe: How to create a dll wrapper Pin
VentsyV4-Aug-10 5:33
VentsyV4-Aug-10 5:33 
GeneralRe: How to create a dll wrapper Pin
Aescleal4-Aug-10 5:55
Aescleal4-Aug-10 5:55 
GeneralRe: How to create a dll wrapper Pin
VentsyV4-Aug-10 6:09
VentsyV4-Aug-10 6:09 
AnswerRe: How to create a dll wrapper Pin
Aescleal4-Aug-10 5:02
Aescleal4-Aug-10 5:02 
I wouldn't try using library interpositioning for this sort of thing. While you can implement a DLL that calls selectively forwards functions to another DLL it ends up being a bit of a headache [1]. The approach I tend to use is...

- wrap the DLL in a class
- extract an interface class out of the class you've implemented (all the functions are pure virtual)
- implement the interface again, passing the bits you want through to the DLL and reimplementing the bits you don't want to
- select at runtime or compile time (depending on the type of testing you want to do) which implementation of the interface you want to use

This method is something to consider with any third party library so when it doesn't work properly you've got a central point to either replace it or patch its functionality.

Cheers,

Ash

[1] If you really want to do use library interpositioning then...

- reimplement the entire interface of the wrapped DLL, starting off by just returning succeeded, true, whatever is appropriate
- reimplement the functions you want to pass through by (a) manually loading the wrapped DLL and (b) calling the wrapped function
- reimplement the bits you don't want to pass through however you want

This saves the balls ache of link order of the wrapping and wrapped libraries.
GeneralRe: How to create a dll wrapper Pin
VentsyV4-Aug-10 5:31
VentsyV4-Aug-10 5:31 
GeneralRe: How to create a dll wrapper Pin
Aescleal4-Aug-10 5:47
Aescleal4-Aug-10 5:47 
GeneralRe: How to create a dll wrapper Pin
VentsyV4-Aug-10 6:11
VentsyV4-Aug-10 6:11 
GeneralRe: How to create a dll wrapper Pin
Aescleal4-Aug-10 7:54
Aescleal4-Aug-10 7:54 
AnswerRe: How to create a dll wrapper Pin
Shivanand Gupta5-Aug-10 0:40
Shivanand Gupta5-Aug-10 0:40 
Questioncompile file exe Pin
albertodiprima4-Aug-10 3:51
albertodiprima4-Aug-10 3:51 
AnswerRe: compile file exe Pin
Cedric Moonen4-Aug-10 3:57
Cedric Moonen4-Aug-10 3:57 
GeneralRe: compile file exe Pin
albertodiprima4-Aug-10 4:05
albertodiprima4-Aug-10 4:05 
AnswerRe: compile file exe Pin
Sauro Viti4-Aug-10 3:59
professionalSauro Viti4-Aug-10 3:59 
GeneralRe: compile file exe Pin
albertodiprima4-Aug-10 4:23
albertodiprima4-Aug-10 4:23 
GeneralRe: compile file exe Pin
Sauro Viti4-Aug-10 4:33
professionalSauro Viti4-Aug-10 4:33 
GeneralRe: compile file exe Pin
albertodiprima4-Aug-10 4:45
albertodiprima4-Aug-10 4:45 
GeneralRe: compile file exe Pin
Sauro Viti4-Aug-10 4:53
professionalSauro Viti4-Aug-10 4:53 
GeneralRe: compile file exe Pin
albertodiprima4-Aug-10 4:57
albertodiprima4-Aug-10 4:57 
AnswerRe: compile file exe Pin
Sauro Viti4-Aug-10 5:09
professionalSauro Viti4-Aug-10 5:09 
GeneralRe: compile file exe Pin
albertodiprima4-Aug-10 5:17
albertodiprima4-Aug-10 5:17 
GeneralRe: compile file exe Pin
Emilio Garavaglia4-Aug-10 21:37
Emilio Garavaglia4-Aug-10 21:37 

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.