| re: pass pointer to a thread function ?
"mandatory" <okllsam@nptklooohs.ru> wrote...[color=blue]
> "Victor Bazarov"[color=green]
>>
>> Not if the class function is a non-static member. See the FAQ, section
>> 33.
>>[color=darkred]
>>> [..][/color]
>>
>> V[/color]
>
>
> hi victor !
>
> thanks, but im not completely sure, but i think you might have
> misunderstood me.
>
> My goal isnt to start a memberfunction as a thread, im fully aware that
> this has to be a static function outside the class (and then there are
> some ways of make it "feel" its inside the class).
>
> My goal is merely to pass on a address of a (static/global) function to a
> class-member-function - like GetProcAddress() but just not from a library.[/color]
OK, I probably did misunderstand you. What problem do you have, then?
Your member function has to accept a pointer to a function as its argument
and when you pass it a function, it decays to a pointer to that function,
and everything is peachy.
If section 33 doesn't apply to your problem (which I admit is likely),
then you need to give FAQ 5.8 a try.
V |