Solved

user-defined message from DLL to CView

Posted on 2000-05-10
1
166 Views
Last Modified: 2013-12-03
I am sending a message from a DLL using PostThreadMessage to the main thread but I could catch the message only in CMainFrame class. But I would like to get it in CView. I tried to write the message handler in CView but it did not help. How can I do it?
0
Comment
Question by:keremcaglar
1 Comment
 
LVL 4

Accepted Solution

by:
saurabh_dasgupta earned 50 total points
Comment Utility
PostMessage(HWND, msg ..) would have  worked fine if you want to asynchronously pass a message to a specified window.

The DLL may or may not know the window handle of the window that is encapsulated by the CView . It knows the thread id to which the message is to be posted .

In your DLL, you are doing a PostThreadMessage , and this is handled by your CMainFrame window . Since you are able to handle the message in CFrame, why not a write a message handler in CFrame to pass on this message to the CView ?

I think that , by doing the above, you will not be deviating from your original design concept of the DLL not knowning anything about the CView, and only using the threadId for posting the message.

Further , you must remember that all the messages that are posted using PostThreadMessage , have the hwnd member of the MSG structure returned from GetMessage equal to NULL.

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now