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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -