Solved

user-defined message from DLL to CView

Posted on 2000-05-10
1
179 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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