Click here to Skip to main content
15,911,707 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHelp! Crystal Report for VC++ project (VS2008) Pin
shiokbarnabas9-Aug-12 17:11
shiokbarnabas9-Aug-12 17:11 
AnswerRe: Help! Crystal Report for VC++ project (VS2008) Pin
_Flaviu9-Aug-12 19:09
_Flaviu9-Aug-12 19:09 
GeneralFunction to pointer problem Pin
_Flaviu9-Aug-12 7:49
_Flaviu9-Aug-12 7:49 
I try follow code :
C++
// header
private:
	float Plus(float a, float b){return a + b;}
	float Minus(float a, float b){return a - b;}
	float Multiply(float a, float b){return a * b;}
	float Divide(float a, float b){return a / b;}

	float SwitchWithFunctionPointer(float a, float b, float(*PointToFunction)(float,float));

and implementation:
C++
float CTestBeginnerView::SwitchWithFunctionPointer(float a, float b, float(*PointToFunction)(float,float))
{
	return PointToFunction(a,b);
}

void CTestBeginnerView::OnHelpTestfunctionpointer() 
{
	// TODO: Add your command handler code here

	float f = SwitchWithFunctionPointer(4,8,&Plus); // <-- error 2276
}

I get this error :
C++
error C2276: '&' : illegal operation on bound member function expression

can you explain me why ? I reproduced the example from here[^]
GeneralRe: Function to pointer problem Pin
Chris Losinger9-Aug-12 8:34
professionalChris Losinger9-Aug-12 8:34 
GeneralRe: Function to pointer problem Pin
_Flaviu9-Aug-12 8:38
_Flaviu9-Aug-12 8:38 
GeneralRe: Function to pointer problem Pin
enhzflep9-Aug-12 8:43
enhzflep9-Aug-12 8:43 
GeneralRe: Function to pointer problem Pin
_Flaviu9-Aug-12 19:11
_Flaviu9-Aug-12 19:11 
GeneralRe: Function to pointer problem Pin
wangweixu9-Aug-12 20:14
wangweixu9-Aug-12 20:14 
GeneralRe: Function to pointer problem Pin
Joan M9-Aug-12 23:48
professionalJoan M9-Aug-12 23:48 
QuestionGood bootstrapping resources Pin
Brandon-X120009-Aug-12 2:10
Brandon-X120009-Aug-12 2:10 
AnswerRe: Good bootstrapping resources Pin
Randor 9-Aug-12 5:03
professional Randor 9-Aug-12 5:03 
GeneralMessagebox Pin
sarfaraznawaz8-Aug-12 21:24
sarfaraznawaz8-Aug-12 21:24 
QuestionRe: Messagebox Pin
Eugen Podsypalnikov8-Aug-12 21:40
Eugen Podsypalnikov8-Aug-12 21:40 
GeneralRe: Messagebox Pin
pasztorpisti8-Aug-12 23:23
pasztorpisti8-Aug-12 23:23 
GeneralRe: Messagebox Pin
sarfaraznawaz10-Aug-12 1:27
sarfaraznawaz10-Aug-12 1:27 
GeneralRe: Messagebox Pin
pasztorpisti10-Aug-12 2:27
pasztorpisti10-Aug-12 2:27 
GeneralRe: Messagebox Pin
sarfaraznawaz12-Aug-12 19:39
sarfaraznawaz12-Aug-12 19:39 
GeneralRe: Messagebox Pin
pasztorpisti12-Aug-12 19:50
pasztorpisti12-Aug-12 19:50 
GeneralRe: Messagebox Pin
pasztorpisti9-Aug-12 20:55
pasztorpisti9-Aug-12 20:55 
QuestionHow to check if a character is from keyboard in MFC Pin
Andraw1118-Aug-12 10:50
Andraw1118-Aug-12 10:50 
QuestionRe: How to check if a character is from keyboard in MFC Pin
Eugen Podsypalnikov8-Aug-12 11:03
Eugen Podsypalnikov8-Aug-12 11:03 
AnswerRe: How to check if a character is from keyboard in MFC Pin
Software_Developer8-Aug-12 20:05
Software_Developer8-Aug-12 20:05 
GeneralRe: How to check if a character is from keyboard in MFC Pin
Peter_in_27808-Aug-12 20:25
professionalPeter_in_27808-Aug-12 20:25 
GeneralRe: How to check if a character is from keyboard in MFC Pin
Software_Developer8-Aug-12 21:43
Software_Developer8-Aug-12 21:43 
JokeRe: How to check if a character is from keyboard in MFC Pin
Eugen Podsypalnikov8-Aug-12 22:17
Eugen Podsypalnikov8-Aug-12 22:17 

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.