can I provide a C++ class member function to windows API? should I specify the calling convention?
if it is not possible, currently i am passing a standalone function to be called back, but how can I access my main window's CDialog variable correctly? passing a pointer to the CDialog there is fine and I can access member variables, but invoking ui element member class crash the application. do i need some kind of synchronization protect?
can I provide a C++ class member function to windows API?
It is possible, but it wouldn't be a class member, it would be a class per "Windows object". And operating systems have many objects.
Maybe you mean having some class that encapsulates a Windows object and mapping a member of that class onto a Windows function. I dunno.
should I specify the calling convention?
It depends on what you're doing, but I'd guess no.
i am passing a standalone function to be called back, but how can I access my main window's CDialog variable correctly?
Callbacks tend to have a context pointer of type void* that passes thru something. You should pass a pointer to the CDialog in that pointer.
do i need some kind of synchronization protect?
Maybe, but it won't be a multi-threaded sync object, it'll be some kind of reference counter as the callback can be further up the call stack in the same thread.