Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help with CEdit please !!!! Pin
Parish7-Oct-01 11:10
Parish7-Oct-01 11:10 
GeneralOwner Drawn Buttons Pin
Derek Lakin4-Sep-01 0:31
Derek Lakin4-Sep-01 0:31 
GeneralRe: Owner Drawn Buttons Pin
Christian Graus4-Sep-01 0:36
protectorChristian Graus4-Sep-01 0:36 
GeneralRe: Owner Drawn Buttons Pin
George4-Sep-01 0:50
George4-Sep-01 0:50 
GeneralRe: Owner Drawn Buttons Pin
Christian Graus4-Sep-01 1:11
protectorChristian Graus4-Sep-01 1:11 
GeneralRe: Owner Drawn Buttons Pin
Derek Lakin4-Sep-01 2:38
Derek Lakin4-Sep-01 2:38 
GeneralInsert MSChart controle in VC++ activex project Pin
3-Sep-01 23:09
suss3-Sep-01 23:09 
QuestionHow do i get the HWND for PostMessage Pin
Yves3-Sep-01 22:48
Yves3-Sep-01 22:48 
I have a main Dialog application wich instantiate a new Dialog Like this...
m_pThread= AfxBeginThread(RUNTIME_CLASS(CMultiThread));
CMultiThread is a CWinThread .
This one takes care of Showing the new dialog box on the screen
BOOL CMultiThread::InitInstance()
{
CPostDialog Dlg;
//CoInitializeEx(0, COINIT_APARTMENTTHREADED);
CoInitializeEx(0, COINIT_MULTITHREADED);
m_pMainWnd= &Dlg;
Dlg.DoModal();
return TRUE;
}

Everythings is working fine.
On the ExitInstance() of this thread i want to post a message to the caller (Main Dialog) that CPostDialog is now over.
The problem is no matter what i try i can't get the HWND of
the caller.
I think that i should get the HWND in the InitInstance
What i did so far in the main dialog is to declare a public variable like this
HWND m_LocalWnd;
Then on the OnInitDialog() of the main dialog

m_LocalWnd =m_hWnd;

Then i change the InitInstance of my CWinThread like this
BOOL CMultiThread::InitInstance()
{
CMessageTestDlg pApp;
m_HwndSource = pApp.m_hWnd;
CPostDialog Dlg;
//CoInitializeEx(0, COINIT_APARTMENTTHREADED);
CoInitializeEx(0, COINIT_MULTITHREADED);
m_pMainWnd= &Dlg;
Dlg.DoModal();
return TRUE;
}
CMessageTestDlg is already running and i should be able
to get the HWND..
but it always return 0
What is it wrong.


Yves Lessard
AnswerRe: How do i get the HWND for PostMessage Pin
Steen Krogsgaard4-Sep-01 1:31
Steen Krogsgaard4-Sep-01 1:31 
GeneralRe: How do i get the HWND for PostMessage Pin
Steen Krogsgaard4-Sep-01 2:03
Steen Krogsgaard4-Sep-01 2:03 
QuestionHow do I disable system menu buttons Pin
3-Sep-01 21:40
suss3-Sep-01 21:40 
AnswerRe: How do I disable system menu buttons Pin
JerzyPeter4-Sep-01 3:13
JerzyPeter4-Sep-01 3:13 
GeneralRe: How do I disable system menu buttons Pin
4-Sep-01 11:19
suss4-Sep-01 11:19 
GeneralRe: How do I disable system menu buttons Pin
The_Server4-Sep-01 13:18
The_Server4-Sep-01 13:18 
GeneralRe: How do I disable system menu buttons Pin
4-Sep-01 17:52
suss4-Sep-01 17:52 
GeneralRe: How do I disable system menu buttons Pin
Tim Deveaux5-Sep-01 7:29
Tim Deveaux5-Sep-01 7:29 
QuestionTrackPopupMenu - What am I doing wrong? Pin
James Bird3-Sep-01 21:31
James Bird3-Sep-01 21:31 
AnswerRe: TrackPopupMenu - What am I doing wrong? Pin
3-Sep-01 22:45
suss3-Sep-01 22:45 
GeneralRe: TrackPopupMenu - What am I doing wrong? Pin
James Bird3-Sep-01 23:15
James Bird3-Sep-01 23:15 
GeneralRe: TrackPopupMenu - What am I doing wrong? Pin
Christian Graus3-Sep-01 23:49
protectorChristian Graus3-Sep-01 23:49 
AnswerRe: TrackPopupMenu - What am I doing wrong? Pin
Steen Krogsgaard4-Sep-01 0:15
Steen Krogsgaard4-Sep-01 0:15 
AnswerRe: TrackPopupMenu - What am I doing wrong? Pin
Rashid Thadha4-Sep-01 0:29
Rashid Thadha4-Sep-01 0:29 
AnswerRe: TrackPopupMenu - What am I doing wrong? Pin
James Bird4-Sep-01 4:22
James Bird4-Sep-01 4:22 
General.xls and Visual C++ Pin
3-Sep-01 21:24
suss3-Sep-01 21:24 
GeneralRe: .xls and Visual C++ Pin
Michael P Butler3-Sep-01 22:14
Michael P Butler3-Sep-01 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.