Solved

user-defined message from DLL to CView

Posted on 2000-05-10
1
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
saurabh_dasgupta earned 50 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

628 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