11 Mar
2005
11 Mar
'05
12:14 p.m.
Olenhouse, Jason wrote:
I'm trying to pass a member function pointer around to the Windows Service Control Manager through Windpws API functions, but I think I'm having troubles with the __stdcall convention. <snip>
No, the problem is passing a member function pointer. A member function pointer is not type-compatible with a function pointer with the same parameter types, regardless of whether they have the same calling convention. ServiceMain has to be a static member or free function. If you really need to pass your own argument(s) to it then use a static variable or TLS slot. Ben.