Click here to Skip to main content
15,890,741 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionInternet Explorer History Pin
rajeevktripathi24-May-06 3:53
rajeevktripathi24-May-06 3:53 
AnswerRe: Internet Explorer History Pin
Chris Losinger24-May-06 4:43
professionalChris Losinger24-May-06 4:43 
AnswerRe: Internet Explorer History Pin
David Crow24-May-06 4:50
David Crow24-May-06 4:50 
Questionboost::weak_ptr exception Pin
LionAM24-May-06 3:32
LionAM24-May-06 3:32 
Question(High-color) icon management Pin
Andre xxxxxxx24-May-06 3:24
Andre xxxxxxx24-May-06 3:24 
AnswerRe: (High-color) icon management Pin
grigsoft24-May-06 6:56
grigsoft24-May-06 6:56 
GeneralRe: (High-color) icon management Pin
Andre xxxxxxx24-May-06 9:08
Andre xxxxxxx24-May-06 9:08 
QuestionPassing on varargs Pin
Steve S24-May-06 3:13
Steve S24-May-06 3:13 
I feel that I really should know this, but I'm having an off-day, and I've just been told my car needs new wheel-bearings, a brake caliper and disc on one of the wheels, which would at least explain why I keep having to turn the radio up Smile | :)

I have a function int __cdecl xxx(const char* value, ...) which is in a C DLL. I'm writing a wrapper class which loads the DLL and and does a GetProcAddress to retrieve the function address. So far so good. Except that for my wrapper class, I'm providing a wrapper::xxx member which (having checked the DLL is loaded and the proc address isn't null) will call down through the pointer.

So I have

int xxx(const char*value,...)

as a member function, and

int (__cdecl *m_pf_xxx)(const char*,...)

as a member too.

What incantation do I need to get my class function to call via the pointer?
If it wasn't for the variable args, it would be

(*m_pf_xxx)(format);

but of course, I need to pass the other args if there are any...

The reason for doing it this way is that the DLL is a 3rd party one (one of a set, in fact), which is loaded at runtime. I can't simply delayload, since the DLL is specified by configuration at runtime, and the wrapper class handles multiple similar ones (think of a codec, for instance).

Like I say, I ought to know this; and before anyone suggests it, I can't change the DLLs, since they are 3rd party, and the developers are not interested in changing them (of course). Trouble is, I'm tied to using them in this instance.

Steve S
Developer for hire
AnswerRe: Passing on varargs Pin
Chris Losinger24-May-06 3:21
professionalChris Losinger24-May-06 3:21 
GeneralRe: Passing on varargs Pin
Steve S24-May-06 3:41
Steve S24-May-06 3:41 
QuestionRe: Multi columns values in combo box [modified] Pin
David Crow24-May-06 3:03
David Crow24-May-06 3:03 
QuestionWrite CD Pin
devcdd24-May-06 2:29
devcdd24-May-06 2:29 
QuestionRe: Write CD Pin
David Crow24-May-06 3:04
David Crow24-May-06 3:04 
AnswerRe: Write CD Pin
devcdd24-May-06 22:52
devcdd24-May-06 22:52 
QuestionRe: Write CD Pin
David Crow25-May-06 2:44
David Crow25-May-06 2:44 
AnswerRe: Write CD Pin
devcdd25-May-06 4:00
devcdd25-May-06 4:00 
GeneralRe: Write CD Pin
David Crow25-May-06 4:04
David Crow25-May-06 4:04 
QuestionTools for logging funtion parameter values Pin
Anil_vvs24-May-06 2:18
Anil_vvs24-May-06 2:18 
AnswerRe: Tools for logging funtion parameter values Pin
Maximilien24-May-06 2:33
Maximilien24-May-06 2:33 
GeneralRe: Tools for logging funtion parameter values Pin
Anil_vvs24-May-06 2:42
Anil_vvs24-May-06 2:42 
QuestionHow to get wavein device property ? [modified] Pin
asd9853724-May-06 2:08
asd9853724-May-06 2:08 
QuestionRegistering Windows Service Pin
guestcat24-May-06 1:54
guestcat24-May-06 1:54 
QuestionRe: Registering Windows Service Pin
David Crow24-May-06 3:06
David Crow24-May-06 3:06 
Questionreg files Pin
aaaan24-May-06 1:53
aaaan24-May-06 1:53 
AnswerRe: reg files Pin
guestcat24-May-06 1:55
guestcat24-May-06 1:55 

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.