c++ - MFC Send the object in message -


can send message object? like:

myclass *myobj = new myclass(); pdlg->sendmessage(myevent, null, (lparam)&myobj); // sends without errors ... afx_msg lresult myapp::getevent(wparam wparam, lparam lparam) {     myclass *zxc = new myclass();     zxc = lparam; // this... doesn't work } 

just cast pointer there-and-back appropriate:

sender:

pdlg->sendmessage(myevent, null, reinterpret_cast<lparam>(&myobj)); 

receiver:

afx_msg lresult myapp::getevent(wparam wparam, lparam lparam) {     myclass * zxc = reinterpret_cast<myclass*>(lparam);     // ... } 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -