Click here to Skip to main content
15,903,741 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralPWSTR length Pin
dabayi17-Feb-05 1:45
dabayi17-Feb-05 1:45 
GeneralRe: PWSTR length Pin
ThatsAlok17-Feb-05 3:03
ThatsAlok17-Feb-05 3:03 
GeneralRe: PWSTR length Pin
dabayi17-Feb-05 3:17
dabayi17-Feb-05 3:17 
GeneralRe: PWSTR length Pin
ThatsAlok17-Feb-05 4:50
ThatsAlok17-Feb-05 4:50 
GeneralRe: PWSTR length Pin
dabayi17-Feb-05 5:22
dabayi17-Feb-05 5:22 
Generalcalling member functions from a map Pin
Malcolm Smart16-Feb-05 21:43
Malcolm Smart16-Feb-05 21:43 
GeneralRe: calling member functions from a map Pin
Stuart Dootson17-Feb-05 10:33
professionalStuart Dootson17-Feb-05 10:33 
GeneralRe: calling member functions from a map Pin
Malcolm Smart17-Feb-05 21:46
Malcolm Smart17-Feb-05 21:46 
Many thanks Stuart - worked a treat.....except, if they add a new section to the XML without telling me I bombout - so I have to first makesure the handler is in the map :-
FuncMAP::iterator iter = funcMap.find(SectionSubString);
if (iter != funcMap.end())
   (this->iter)(); <-- error C2064: term does not evaluate to a function

//FuncMAP is 
//    typedef map<string , void (MyClass::*)() >FuncMAP;

I really have tried to sort this myself - honest!! - I've tried
(this->*iter)();
(this->*(*iter))();
//and various combinations...


for now I am using the following - but that entails two map scans instead of one with the iterator

if (funcMap.find(SectionSubString) != funcMap.end())//do we have a handler
   (this->*(funcMap[SectionSubString]))();//yes - call it


I tried the following :-

void (MyClass::*)() fPtr;   <--- can't determine what this line should be..
fPtr = funcMap[SectionSubString];//get the address
if (fPtr)//if the address is valid
    (this->*fptr)() ;//call it


I've also trawled the web for something similar and come up blank....

Basically I knew virtually nothing about member function pointers, how to call them, how to define a variable to hold one etc. I still don't know much, but I can at least store one in a map and call it (if I know it is going to exist!). Any help again, much appreciated.

*********************************************
The sooner you fall behind, the longer you have to catch up.
GeneralRe: calling member functions from a map Pin
Stuart Dootson18-Feb-05 4:39
professionalStuart Dootson18-Feb-05 4:39 
GeneralRe: calling member functions from a map Pin
Malcolm Smart18-Feb-05 5:36
Malcolm Smart18-Feb-05 5:36 
GeneralProblem with regular C Class in ATL Pin
rwestgraham16-Feb-05 0:06
rwestgraham16-Feb-05 0:06 
Questionhow to provide same con. point in different objects Pin
grinder15-Feb-05 23:00
grinder15-Feb-05 23:00 
GeneralList Control in ATL dialog Pin
abel66615-Feb-05 8:10
abel66615-Feb-05 8:10 
GeneralRe: List Control in ATL dialog Pin
Michael Dunn15-Feb-05 8:49
sitebuilderMichael Dunn15-Feb-05 8:49 
GeneralRe: List Control in ATL dialog Pin
abel66615-Feb-05 21:16
abel66615-Feb-05 21:16 
Questionhow to debug exchange store event sink Pin
muh22m15-Feb-05 7:53
muh22m15-Feb-05 7:53 
QuestionHow to get random numbers? Pin
Anonymous14-Feb-05 20:05
Anonymous14-Feb-05 20:05 
Generalspirit and unicode Pin
bruce2g14-Feb-05 14:40
bruce2g14-Feb-05 14:40 
GeneralRe: spirit and unicode Pin
Stuart Dootson15-Feb-05 5:19
professionalStuart Dootson15-Feb-05 5:19 
GeneralATL Collection Problem Pin
ekling14-Feb-05 11:32
ekling14-Feb-05 11:32 
Generalconvert PWSTR to LPCTSTR Pin
dabayi14-Feb-05 0:03
dabayi14-Feb-05 0:03 
GeneralRe: convert PWSTR to LPCTSTR Pin
rocky_pulley14-Feb-05 2:22
rocky_pulley14-Feb-05 2:22 
GeneralRe: convert PWSTR to LPCTSTR Pin
dabayi14-Feb-05 3:17
dabayi14-Feb-05 3:17 
GeneralRe: convert PWSTR to LPCTSTR Pin
Michael Dunn14-Feb-05 3:20
sitebuilderMichael Dunn14-Feb-05 3:20 
GeneralCommandBarControl.OnAction don't want to work Pin
JabraJabra12-Feb-05 22:01
JabraJabra12-Feb-05 22:01 

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.