Click here to Skip to main content
15,918,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: doc-view and database problem Pin
Prakash Nadar14-Mar-04 0:25
Prakash Nadar14-Mar-04 0:25 
GeneralRequired header <conio.h> of C-library Pin
oOomen13-Mar-04 23:48
oOomen13-Mar-04 23:48 
GeneralRe: Required header &lt;conio.h&gt; of C-library Pin
Prakash Nadar14-Mar-04 0:23
Prakash Nadar14-Mar-04 0:23 
GeneralRe: Required header &lt;conio.h&gt; of C-library Pin
oOomen14-Mar-04 2:02
oOomen14-Mar-04 2:02 
GeneralRe: Required header &lt;conio.h&gt; of C-library Pin
Prakash Nadar14-Mar-04 2:20
Prakash Nadar14-Mar-04 2:20 
GeneralRe: Required header <conio.h> of C-library Pin
oOomen14-Mar-04 3:57
oOomen14-Mar-04 3:57 
GeneralRe: Required header &lt;conio.h&gt; of C-library Pin
Prakash Nadar14-Mar-04 6:01
Prakash Nadar14-Mar-04 6:01 
GeneralMFC: Problem using CWnd::SendMessage Pin
Davex_13-Mar-04 17:20
Davex_13-Mar-04 17:20 
Hello all,

I'm presently learning how to use my own message handlers in my MFC application. I read this article: Windows Message Handling - Part 2 here: http://www.codeproject.com/dialog/messagehandling2.asp.

I have a problem with one line of code; when I need to get the CWnd* to send the message.
In my case, I want to send the message to my main view based on CFormView when I'm in another dialog or class.
Here's how I was trying to do it:

pMyMainView = CWnd::FindWindow(_T("CMyMainView"),NULL);
pMyMainView->SendMessage(WM_MYMESSAGE,0,0);

But FindWindow don't find my CMyMainView, so I can't send the message.

I tried "this->SendMessage(WM_MYMESSAGE,0,0);" in my CMyMainView.cpp to verify my message handler and it's working.


It must be so simple! But I started coding in C++ and MFC only 1 month ago. Smile | :)


Thanks,
Dave

GeneralRe: MFC: Problem using CWnd::SendMessage Pin
Ravi Bhavnani13-Mar-04 17:28
professionalRavi Bhavnani13-Mar-04 17:28 
GeneralRe: MFC: Problem using CWnd::SendMessage Pin
Davex_14-Mar-04 4:16
Davex_14-Mar-04 4:16 
GeneralProperty Pages/Sheets/Tab Controls Pin
Anonymous13-Mar-04 14:41
Anonymous13-Mar-04 14:41 
GeneralRe: Property Pages/Sheets/Tab Controls Pin
Prakash Nadar13-Mar-04 15:31
Prakash Nadar13-Mar-04 15:31 
GeneralRe: Property Pages/Sheets/Tab Controls Pin
Ravi Bhavnani13-Mar-04 17:35
professionalRavi Bhavnani13-Mar-04 17:35 
GeneralCreateProcess in WinXP Home Pin
Wojciech Klessa13-Mar-04 9:53
Wojciech Klessa13-Mar-04 9:53 
GeneralRe: CreateProcess in WinXP Home Pin
Michael Dunn13-Mar-04 10:22
sitebuilderMichael Dunn13-Mar-04 10:22 
GeneralRe: CreateProcess in WinXP Home Pin
Wojciech Klessa13-Mar-04 10:37
Wojciech Klessa13-Mar-04 10:37 
Generalexport MySql Table to DBase Table Pin
BlackDice13-Mar-04 9:24
BlackDice13-Mar-04 9:24 
GeneralBitmap blit using DirectX Pin
Christopher Lloyd13-Mar-04 8:17
Christopher Lloyd13-Mar-04 8:17 
GeneralRe: Bitmap blit using DirectX Pin
JWood13-Mar-04 8:57
JWood13-Mar-04 8:57 
GeneralRe: Bitmap blit using DirectX Pin
Christopher Lloyd15-Mar-04 1:13
Christopher Lloyd15-Mar-04 1:13 
GeneralPrint Grid In MFC Pin
Nike_pointer13-Mar-04 7:13
Nike_pointer13-Mar-04 7:13 
Generalbackground color of system tray Pin
quzi13-Mar-04 7:04
quzi13-Mar-04 7:04 
GeneralRe: background color of system tray Pin
Prakash Nadar13-Mar-04 15:23
Prakash Nadar13-Mar-04 15:23 
GeneralRe: background color of system tray Pin
quzi14-Mar-04 19:54
quzi14-Mar-04 19:54 
GeneralRe: background color of system tray Pin
Prakash Nadar14-Mar-04 20:11
Prakash Nadar14-Mar-04 20:11 

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.