winapi - Is there any way to make the DialogProc work without declaring as Nonstatic -


i have developed button application using createdialogparam , dialogproc. first declared dialoproc method static in order make every thing work fine , worked situation there many variables(not globally declared) , functions have use inside dialogproc function , want make non static because making static makes me not implement few more things.

if don't declare static gives error

    m_hwndpreview = createdialogparam( g_hinst,makeintresource(idd_maindialog), m_hwndparent,(dlgproc)dialogproc, (lparam)this);  //('type cast' cannot convert 'overloaded-function'  //to 'dlgproc') 

is there solution make dialogproc function without declaring static ???

it must static function because windows calls c code, not c++ code. there several ways static function can retrieve 'this' pointer saved somewhere, use pointer call class member function. every gui library available windows solves problem: consider using one.


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -