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

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -