Click here to Skip to main content
16,012,034 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Casting thread functions Pin
Tim Deveaux24-Feb-01 15:07
Tim Deveaux24-Feb-01 15:07 
GeneralRe: Casting thread functions Pin
Joe Moldovan24-Feb-01 18:21
Joe Moldovan24-Feb-01 18:21 
GeneralRe: Casting thread functions Pin
NormDroid25-Feb-01 5:41
professionalNormDroid25-Feb-01 5:41 
GeneralRe: Casting thread functions Pin
Tim Deveaux24-Feb-01 14:58
Tim Deveaux24-Feb-01 14:58 
GeneralRe: Casting thread functions Pin
Todd Wilson24-Feb-01 15:20
Todd Wilson24-Feb-01 15:20 
GeneralRe: Casting thread functions Pin
Tim Deveaux24-Feb-01 15:32
Tim Deveaux24-Feb-01 15:32 
GeneralRe: Casting thread functions Pin
Erik Funkenbusch26-Feb-01 12:55
Erik Funkenbusch26-Feb-01 12:55 
GeneralRe: Casting thread functions Pin
Todd Wilson26-Feb-01 13:13
Todd Wilson26-Feb-01 13:13 
Ah, but it is portable - see Inside the C++ Object Model (S. Lippman), pages 121-124. Static functions are managled internally into non-class functions. "Taking the address of a static memmber function always yields the value of its location in memory, that is, its address. Because the static function is without a this pointer, the type of its address is not a pointer to a class member function but the type of a nonmember pointer to function." Sadly, the ARM doesn't give more than a trivial explanation of static data and functions, other than they have "external linkage". What reference were you using for the undefiend functionality?

In any case, you can work around the private/protected problem like this:

void bogus(void *ptr) { ((Fred*)ptr)->publicBogus(); }

class Fred
{
public:
void publicBogus() { ; /* do the real work here */ }

};
GeneralRe: Casting thread functions Pin
Erik Funkenbusch26-Feb-01 13:32
Erik Funkenbusch26-Feb-01 13:32 
GeneralRe: Casting thread functions Pin
Joe Moldovan24-Feb-01 17:44
Joe Moldovan24-Feb-01 17:44 
GeneralRe: Casting thread functions Pin
Tim Deveaux25-Feb-01 5:13
Tim Deveaux25-Feb-01 5:13 
GeneralRe: Casting thread functions Pin
Erik Funkenbusch26-Feb-01 13:11
Erik Funkenbusch26-Feb-01 13:11 
GeneralRe: Casting thread functions Pin
Joe Moldovan26-Feb-01 19:45
Joe Moldovan26-Feb-01 19:45 
QuestionHow to use handle_wm_notify macro which comes with win32? Pin
Sachin23-Feb-01 23:04
Sachin23-Feb-01 23:04 
AnswerRe: How to use handle_wm_notify macro which comes with win32? Pin
Sardaukar24-Feb-01 1:23
Sardaukar24-Feb-01 1:23 
GeneralOnSize Pin
Starodubtsev Sergey23-Feb-01 22:53
Starodubtsev Sergey23-Feb-01 22:53 
GeneralRe: OnSize Pin
Erik Funkenbusch26-Feb-01 13:17
Erik Funkenbusch26-Feb-01 13:17 
Generaltitle text on the main frame Pin
Starodubtsev Sergey23-Feb-01 22:20
Starodubtsev Sergey23-Feb-01 22:20 
GeneralRe: title text on the main frame Pin
Christian Graus23-Feb-01 22:23
protectorChristian Graus23-Feb-01 22:23 
Generalcreate an exe file from another Pin
Sachin23-Feb-01 15:01
Sachin23-Feb-01 15:01 
GeneralRe: create an exe file from another Pin
Tim Deveaux24-Feb-01 4:14
Tim Deveaux24-Feb-01 4:14 
QuestionHow to install source patch with VC++? Pin
23-Feb-01 13:09
suss23-Feb-01 13:09 
QuestionHow to install source patch with VC++? Pin
23-Feb-01 13:08
suss23-Feb-01 13:08 
GeneralWinsock problem - PLEASE help Pin
23-Feb-01 11:11
suss23-Feb-01 11:11 
GeneralRe: Winsock problem - PLEASE help Pin
Tim Deveaux23-Feb-01 13:06
Tim Deveaux23-Feb-01 13:06 

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.