Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

user-defined message from DLL to CView

Posted on 2000-05-10
1
Medium Priority
?
191 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 150 total points
ID: 2796424
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 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