ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fail to sendmessage to CAD

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
27925916
412 Views, 2 Replies

fail to sendmessage to CAD

I use a MFC program to sendMessage to  CAD by its hwnd returned from this code "acedGetAcadWinApp()->GetMainWnd()->GetSafeHwnd",and use "acedRegisterFilterWinMsg" to regist a function ,however it can't catch any message from the MFC program.

acedRegisterFilterWinMsg(MonitorWinMsg);
BOOL MonitorWinMsg(MSG* pMsg)
{
  if(pMsg->hwnd == acedGetAcadWinApp()->GetMainWnd()->GetSafeHwnd() && pMsg->lParam != NULL)
{
  return FALSE;//GET the mesasge from MFC Program
}
}
2 REPLIES 2
Message 2 of 3

You can try adsw_acadMainWnd instead of acedGetAcadWinApp()->GetMainWnd()->GetSafeHwnd

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 3

I use postMessage instead of sendMessage ,it works!😂

Tags (1)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report