Jump to content
  • Advertisement
Sign in to follow this  
dani333

Post message from dll function

This topic is 5058 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a client app with a progress bar ( MFC Visual C++). The client calls a dll function , and I need to update the progress bar on the client dialog from my dll function,i'm using this setting:
ClientDlg.h app:

#define WM_USER_UPDATE_PROGRESS (WM_APP+0x102)

afx_msg LRESULT OnUpdateProgress(WPARAM wParam,LPARAM lParam);
//------------------------------------------------------------
ClientDlg.cpp app:

ON_MESSAGE(WM_USER_UPDATE_PROGRESS, OnThreadUpdateProgress)
LRESULT CClientDlg::OnUpdateProgress(WPARAM wParam,LPARAM lParam)
{
     m_ProgressBar.SetPos(100*(int)wParam/(int)lParam);
     return 0;
}


After transfering the CWnd* pWnd from the client app,and including the header file of the message definitions,i tried to call this function:
pWnd->PostMessage(WM_USER_UPDATE_PROGRESS,3,100);
from my dll function, but I'm getting Assertion Failed:-( What seems to be the problem? Dani. (Edited by moderator to utilise [ source ][ /source ] tags) [Edited by - Timkin on September 15, 2004 6:51:48 PM]

Share this post


Link to post
Share on other sites
Advertisement
First off, I find it somewhat humourous that you have a variable name "pWnd".[smile] *Ahem* Humour aside, however:

Clicky

This appears to be a tutorial site that contains source code similiar to the stuff you provided. I would think, at first glance, that your error lies in the fact that you have "OnUpdateProgress", then "OnThreadUpdateProgress", then "OnUpdateProgress". But then again, I know little in this area(DLL's and threads). Hope it helps!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!