Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help DLL PostMessage ???

Posted on 1998-12-30
3
Medium Priority
?
409 Views
Last Modified: 2013-11-20
Hi,

   I have write a DLL which is staticly linking to the main application and I want to post a message to the main window from the DLL by using PostMessage(...) to indicate the progress of work being done.
   
   However,there 's no success after a number of trials.

   Or what else should I do in order to achieve this purpose???

   Could anyone kindly tell me what's wrong with it???


Thankyou !
0
Comment
Question by:surenechan
[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
  • 2
3 Comments
 
LVL 2

Expert Comment

by:zyqwert
ID: 1327041
Your dll (Dynamic Link Library) is staticly linked?  I'll guess that you mean implicitly linked.

You didn't really give enough information to say what exactly your problem is, but here are some good canidates:


1)The DLL doesn't have the HWND of the main window.  You can check this by using a tool like spy to see what the HWND really is, or many other methods.

2)The DLL and the main program aren't using the same message number.  If you defined the message yourself, make sure both the DLL and the main program are using the same header file.  For testing, try using a predefined message number (WM_USER, or WM_NULL are some good choices).

3) You don't return to your GetMessaageLoop.  This will happen if either the DLL or the Main Program is in a continuous loop and not calling PeekMessage or GetMessage.

If this is the case, and you don't have multiple threads involved, you can use SendMessage.  SendMessage will always transfer control to the Main Window WndProc.

4) You don't have a handler for this particular message.  In which case you just need to add one to your message map.

My guess would be #3.
0
 

Author Comment

by:surenechan
ID: 1327042
Thank you !!!
It work now after I use SendMessage instead of PostMessage .

0
 
LVL 2

Accepted Solution

by:
zyqwert earned 80 total points
ID: 1327043
So now we know the answer was #3.  Glad all is well.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

618 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