A C or C++ conceptual question 
Author Message
 A C or C++ conceptual question

Hi ppl,

Does anyone knows whats the difference between this two difinitions:

typedef UINT (CScheduledThread::*TIMERPROC)(void);

and

typedef UINT (*TIMERPROC)(void);

I used it in my CSchedulerThread, the difference i get when using a variable
of this type in my program, according to the first difinition i should write
somethign like this:

TIMERPROC MyVariable;

(this->*MyVariable)();

but for the second type of difinition i can use this :
(*MyVariable)();

TIA,
M. Shokuie Nia.



Tue, 11 May 2004 21:44:14 GMT  
 A C or C++ conceptual question
    The first defines TIMERPROC to be a CSheduledThread class member
function pointer.   There, a TIMERPROC object can only point to a non-static
CSheduledThread member function.

    The second defines TIMERPROC to be a non-member function pointer.
There a TIMERPROC object can only point a global function or a static member
functions (of any class).

--
Truth,
James Curran
www.NJTheater.com     (Professional)
www.NovelTheory.com  (Personal)
www.BrandsForLess.Com (Day Job)



Quote:
> Hi ppl,

> Does anyone knows whats the difference between this two difinitions:

> typedef UINT (CScheduledThread::*TIMERPROC)(void);

> and

> typedef UINT (*TIMERPROC)(void);

> I used it in my CSchedulerThread, the difference i get when using a
variable
> of this type in my program, according to the first difinition i should
write
> somethign like this:

> TIMERPROC MyVariable;

> (this->*MyVariable)();

> but for the second type of difinition i can use this :
> (*MyVariable)();

> TIA,
> M. Shokuie Nia.



Tue, 11 May 2004 22:09:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. Need C++ text for non cs major course

3. Conceptual questions

4. conceptual question begging answer

5. Conceptual threading question

6. a conceptual question about critical sections

7. conceptual mfc questions on how to go on with my app

8. conceptual mfc questions on how to go on with my app

9. Conceptual question (.net & xsl)

10. How to show/call Form2.cs from Form1.cs ?

11. Include code in other Cs files

12. Reuse of cs files, namespace, arch advice pls

 

 
Powered by phpBB® Forum Software