.NET Client - MFC Regular DLL and user defined messages -


update: .net client making call regular dll. have got extension dll exports class , used in regular dll.

i have got third party dll takes windowhandle , user defined message parameter , starts sending messages passed on window, don't see message coming window. below api call format:

startmessaging(<windowhandle>,wm_message_api); 

i needed regular mfc regular dll create hidden cframewnd window receiving messages. using afx_manage_state() @ entry point dll.

constructor code in cframewnd derived class:

create(null,"mywindow"); hwndframe = this->m_hwnd;

message maps:

lresult cmyderivedwnd::onmsgapi( wparam wparam, lparam lparam ) {  outputdebugstring("onmsgapi");  return (lresult)0; } 

my main class startmessaging called: in constructor instantiate cframewnd object:

myderivedwnd = new cmyderivedwnd(this);

and initiatemessaging called:

void cmain::initiatemessaging()  {   tchar szbuf[80];   ::getwindowtext(myderivedwnd->m_hwnd,szbuf,80);   outputdebugstring((lpstr)(lpctstr)szbuf); //this displays mywindow   startmessaging(myderivedwnd->m_hwnd,wm_message_api);  } 

my getwindowtext function returns correct window name, unable trap wm_message_api message in class. have tried using extension dll same result.

i found problem, not answer yet. threading on c# side causing event not show up.if call c++ interop on main thread, event works, need call on separate thread. planning post question find answer.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -