Click here to Skip to main content
11,642,855 members (76,531 online)

C / C++ / MFC

 
GeneralRe: Stuck with function pointers in C and C++ Pin
Stefan_Lang29-Jan-13 0:02
memberStefan_Lang29-Jan-13 0:02 
GeneralRe: Stuck with function pointers in C and C++ Pin
Simon Langdon29-Jan-13 0:38
memberSimon Langdon29-Jan-13 0:38 
GeneralRe: Stuck with function pointers in C and C++ Pin
Stefan_Lang29-Jan-13 4:31
memberStefan_Lang29-Jan-13 4:31 
GeneralRe: Stuck with function pointers in C and C++ Pin
CPallini25-Jan-13 2:04
mvpCPallini25-Jan-13 2:04 
Freak30 wrote:
If I remember correctly, you can't declare a pointer to a non-static member function in native C++

Actually you can, e.g.
#include<iostream>
using namespace std;
 
class A
{
  int i;
public:
  A(int i):i(i){}
  void show() { cout << i << endl;}
};
 
void  (A::*pmfn)();
 
int main()
{
  A  a(7);
 
  pmfn = &A::show;
 
  (a.*pmfn)();
}

However (and of course) this kind of pointer is not compatible with C-like function pointers.
Veni, vidi, vici.

GeneralRe: Stuck with function pointers in C and C++ Pin
Freak3027-Jan-13 23:30
memberFreak3027-Jan-13 23:30 
AnswerRe: Stuck with function pointers in C and C++ Pin
Stephen Hewitt27-Jan-13 4:40
memberStephen Hewitt27-Jan-13 4:40 
QuestionUSB Device Path Handle Problem Pin
yogeshs24-Jan-13 21:21
memberyogeshs24-Jan-13 21:21 
AnswerRe: USB Device Path Handle Problem Pin
Vaclav_Sal28-Jan-13 10:08
memberVaclav_Sal28-Jan-13 10:08 
QuestionHow to create a button on the right of the screen in mfc.? Pin
mbatra3124-Jan-13 19:53
membermbatra3124-Jan-13 19:53 
AnswerRe: How to create a button on the right of the screen in mfc.? Pin
Richard MacCutchan24-Jan-13 22:47
mvpRichard MacCutchan24-Jan-13 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 3 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid