haeder 선언 부분
void samplecallback(unsigned int count);
typedef void (* SAMCALLBACK)(unsigned int Count);
class CCallback
{
public:
SAMCALLBACK m_Callback;
}
void CCallback ::OnButton1()
{
// TODO: Add your control notification handler code here
// typedef void(* CallBack)(int count);
m_Callback = samplecallback;
// callback 등록 하는 부분.
}
void samplecallback(unsigned int count)
{
::MessageBox(NULL, "CallBack routine", "CallBack routine",MB_OK);
}
void CCallback ::OnButton2()
{
// TODO: Add your control notification handler code here
unsigned int Count =1;
m_Callback(Count); // callback 호출.
}