Click here to Skip to main content
15,867,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem using IAccessible2 Pin
kartikdasani12-Sep-11 2:17
kartikdasani12-Sep-11 2:17 
Questionweb browser control difficulty Pin
doug2512-Sep-11 1:28
doug2512-Sep-11 1:28 
AnswerRe: web browser control difficulty Pin
CPallini12-Sep-11 2:16
mveCPallini12-Sep-11 2:16 
GeneralRe: web browser control difficulty Pin
doug2513-Sep-11 2:50
doug2513-Sep-11 2:50 
AnswerRe: web browser control difficulty Pin
krmed12-Sep-11 3:56
krmed12-Sep-11 3:56 
GeneralRe: web browser control difficulty Pin
doug2513-Sep-11 2:59
doug2513-Sep-11 2:59 
AnswerRe: web browser control difficulty Pin
doug2513-Sep-11 11:18
doug2513-Sep-11 11:18 
QuestionMember function pionters in C++ Pin
Erudite_Eric12-Sep-11 0:30
Erudite_Eric12-Sep-11 0:30 
So I use a lot of function pointers in C, and wanted to add one to a C++ class (MFC).

So I start off with a typedef in my class:

typedef ULONG (MyClass::*MyFunc)(PULONG, PVOID);

The call back:

ULONG MyFunc(PULONG, PVOID);

Another func that takes the callback as a parameter:

ULONG SomeFunc(PULONG, MyFunc, PVOID);



I then write the implementaiton of SomeFunc:
ULONG MyClass::SomeFunc(PULONG pVal, MyFunc pProc, PVOID pOpt)
{
...
}

To call the callback from inside MyClass::SomeFunc() I had to use this syntax:

ULONG ret = (this->*pProc)(&x, NULL);


I couldn't just call (*pProc)(&x, NULL); I had to add the 'this->'.


What a crappy syntax. You dont have to call other member funcs with a 'this->' so why is it required for function pointers?

--edit--

Perhaps it would look better as: (*this.*pProc)(&x, NULL); Smile | :)

Nah, thats WAY to much direction...
==============================

Nothing to say.

AnswerRe: Member function pionters in C++ Pin
Chris Losinger12-Sep-11 1:52
professionalChris Losinger12-Sep-11 1:52 
GeneralRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 2:09
Erudite_Eric12-Sep-11 2:09 
GeneralRe: Member function pionters in C++ Pin
CPallini12-Sep-11 2:13
mveCPallini12-Sep-11 2:13 
GeneralRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 2:33
Erudite_Eric12-Sep-11 2:33 
GeneralRe: Member function pionters in C++ Pin
MicroVirus12-Sep-11 3:08
MicroVirus12-Sep-11 3:08 
GeneralRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 3:09
Erudite_Eric12-Sep-11 3:09 
JokeRe: Member function pionters in C++ Pin
MicroVirus12-Sep-11 8:29
MicroVirus12-Sep-11 8:29 
GeneralRe: Member function pionters in C++ Pin
enhzflep12-Sep-11 18:27
enhzflep12-Sep-11 18:27 
GeneralRe: Member function pionters in C++ Pin
CPallini12-Sep-11 3:19
mveCPallini12-Sep-11 3:19 
GeneralRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 3:50
Erudite_Eric12-Sep-11 3:50 
GeneralRe: Member function pionters in C++ Pin
CPallini12-Sep-11 4:03
mveCPallini12-Sep-11 4:03 
GeneralRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 4:08
Erudite_Eric12-Sep-11 4:08 
QuestionRe: Member function pionters in C++ Pin
CPallini12-Sep-11 4:25
mveCPallini12-Sep-11 4:25 
AnswerRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 4:31
Erudite_Eric12-Sep-11 4:31 
GeneralRe: Member function pionters in C++ Pin
CPallini12-Sep-11 4:33
mveCPallini12-Sep-11 4:33 
GeneralRe: Member function pionters in C++ Pin
Erudite_Eric12-Sep-11 6:28
Erudite_Eric12-Sep-11 6:28 
GeneralRe: Member function pionters in C++ Pin
CPallini12-Sep-11 9:41
mveCPallini12-Sep-11 9:41 

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.