Click here to Skip to main content
15,924,901 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Alt+Tab replacement Pin
Alex Korchemniy17-Dec-04 13:14
Alex Korchemniy17-Dec-04 13:14 
GeneralRe: Alt+Tab replacement Pin
User 665817-Dec-04 14:29
User 665817-Dec-04 14:29 
GeneralRe: Howto update text files Pin
yarp17-Dec-04 3:57
yarp17-Dec-04 3:57 
GeneralRe: Howto update text files Pin
John R. Shaw17-Dec-04 4:59
John R. Shaw17-Dec-04 4:59 
GeneralHowto update text files Pin
yarp17-Dec-04 3:28
yarp17-Dec-04 3:28 
GeneralRe: Howto update text files Pin
Prakash Nadar17-Dec-04 3:46
Prakash Nadar17-Dec-04 3:46 
GeneralWhen "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 2:32
Member 159648417-Dec-04 2:32 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 4:19
John R. Shaw17-Dec-04 4:19 
Wink | ;) Lucky you I just wrote at least a dozen template classes and template functions the take function pointers as arguments so this should help!

Your function pointer agument must match the actual function pointer that is passed (C++ is far more picky than C):

LONG (*Func)(A1,T*) != LONG (WINAPI *Func)(A1,T*)
void (*Func)(T) != void (_cdecl *Func)(T) // THIS PROBABLE THE PROBLEM
void (CDECL *Func(T*) == void (_cdecl *Func)(T*)

Here is a partial example of a templated function that takes a function pointer as an argument (Note the template take the function pointer argument not the function that is produced):
// Get function pattern 1
template<class T, class A1, LONG (WINAPI *Func)(A1,T*)>
T* my_Get1(A1 Arg1)
{
    ...
    T* pData = new T;
    nResult = Func(Arg1,&pData);
    // check for error exc...
    ...
    return pData;
}
// Some function to call templated version
void someFunc()
{
    ...
    MYTYPE pT = my_Get1<MYTYPE,ARGTYPE,MyFunc>(Arg1);
    ...
    delete pT;
}


Have fun!Big Grin | :-D

INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 4:37
Member 159648417-Dec-04 4:37 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 4:46
John R. Shaw17-Dec-04 4:46 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 12:57
Member 159648417-Dec-04 12:57 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 14:06
John R. Shaw17-Dec-04 14:06 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Antony M Kancidrowski17-Dec-04 4:53
Antony M Kancidrowski17-Dec-04 4:53 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 5:44
John R. Shaw17-Dec-04 5:44 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Anonymous17-Dec-04 6:52
Anonymous17-Dec-04 6:52 
Generalchange caption font of dialog for XP Pin
includeh1017-Dec-04 2:08
includeh1017-Dec-04 2:08 
GeneralRe: change caption font of dialog for XP Pin
Prakash Nadar17-Dec-04 4:32
Prakash Nadar17-Dec-04 4:32 
GeneralRe: change caption font of dialog for XP Pin
ThatsAlok17-Dec-04 22:43
ThatsAlok17-Dec-04 22:43 
Generalmethod for determining full application path Pin
scoroop17-Dec-04 2:01
scoroop17-Dec-04 2:01 
GeneralRe: method for determining full application path Pin
krmed17-Dec-04 2:17
krmed17-Dec-04 2:17 
GeneralRe: method for determining full application path Pin
Antony M Kancidrowski17-Dec-04 3:08
Antony M Kancidrowski17-Dec-04 3:08 
GeneralRe: method for determining full application path Pin
scoroop17-Dec-04 4:53
scoroop17-Dec-04 4:53 
GeneralRe: method for determining full application path Pin
Antony M Kancidrowski17-Dec-04 4:58
Antony M Kancidrowski17-Dec-04 4:58 
GeneralRe: method for determining full application path Pin
scoroop17-Dec-04 5:11
scoroop17-Dec-04 5:11 
GeneralRe: method for determining full application path Pin
David Crow20-Dec-04 9:07
David Crow20-Dec-04 9:07 

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.