Click here to Skip to main content
16,008,469 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Linker problem Pin
Cedric Moonen22-Dec-05 3:00
Cedric Moonen22-Dec-05 3:00 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 18:59
ThatsAlok22-Dec-05 18:59 
AnswerRe: Linker problem Pin
Eytukan22-Dec-05 3:19
Eytukan22-Dec-05 3:19 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 19:37
ThatsAlok22-Dec-05 19:37 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 21:39
ThatsAlok22-Dec-05 21:39 
AnswerRe: Linker problem Pin
S. Senthil Kumar22-Dec-05 3:48
S. Senthil Kumar22-Dec-05 3:48 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 18:49
ThatsAlok22-Dec-05 18:49 
GeneralRe: Linker problem Pin
S. Senthil Kumar22-Dec-05 19:12
S. Senthil Kumar22-Dec-05 19:12 
I don't get it. Are you saying you want to solve the problem without changing the function pointer signature and the static modifier?

The problem you have is not in any way related to templates, it's because you are passing a wrong function to be assigned to a function pointer. Take this class for example.
class X
{
public:
	static void Y(bool x)
	{
	}
};


Now if the function pointer is typedeffed to typedef void (*Func)(bool x);, you can do Func f = &X::Y;. However, if the function pointer is typedeffed to typedef void (*X::Func)(bool x);, you can't do Func f = &X::Y;. That's because X::Func implies that the first (or last) parameter of the function pointed to by Func is the "this" pointer (thiscall calling convention). Because static functions don't take the "this" pointer as a parameter, the compiler will reject Func f = &X::Y;.

The solution is to remove the static modifier from Y, or, change the typedef by removing the X:: prefix.


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 19:43
ThatsAlok22-Dec-05 19:43 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 21:33
ThatsAlok22-Dec-05 21:33 
QuestionCOM in C language. Pin
pc_dev22-Dec-05 1:07
pc_dev22-Dec-05 1:07 
AnswerRe: COM in C language. Pin
Cedric Moonen22-Dec-05 1:53
Cedric Moonen22-Dec-05 1:53 
GeneralRe: COM in C language. Pin
pc_dev22-Dec-05 19:51
pc_dev22-Dec-05 19:51 
AnswerRe: COM in C language. Pin
Andy Moore22-Dec-05 6:44
Andy Moore22-Dec-05 6:44 
GeneralRe: COM in C language. Pin
pc_dev22-Dec-05 19:53
pc_dev22-Dec-05 19:53 
QuestionUsing a mask for drawing non rectangular bitmaps Pin
Ward22-Dec-05 0:36
Ward22-Dec-05 0:36 
AnswerRe: Using a mask for drawing non rectangular bitmaps Pin
PJ Arends22-Dec-05 8:43
professionalPJ Arends22-Dec-05 8:43 
AnswerRe: Using a mask for drawing non rectangular bitmaps Pin
Ward25-Dec-05 10:08
Ward25-Dec-05 10:08 
QuestionGetMenu() returns NULL for Visual Studio 2003 Pin
Owner drawn22-Dec-05 0:29
Owner drawn22-Dec-05 0:29 
Question_tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:16
Nishad S22-Dec-05 0:16 
AnswerRe: _tcscpy Vs lstrcpy Pin
toxcct22-Dec-05 0:31
toxcct22-Dec-05 0:31 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:43
Nishad S22-Dec-05 0:43 
GeneralRe: _tcscpy Vs lstrcpy Pin
Blake Miller22-Dec-05 5:41
Blake Miller22-Dec-05 5:41 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 16:23
Nishad S22-Dec-05 16:23 
AnswerRe: _tcscpy Vs lstrcpy Pin
ThatsAlok22-Dec-05 0:53
ThatsAlok22-Dec-05 0:53 

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.