WTL CHAIN_MSG_MAP

  • Thread starter =?iso-8859-2?Q?Piotr_W=F3jcicki?=
  • Start date
?

=?iso-8859-2?Q?Piotr_W=F3jcicki?=

I want my class to draw on MainForm, when MainForm receives OnPaint Message


In MailFrame i have

BEGIN_MSG_MAP(CMainFrame)
CHAIN_MSG_MAP(Tekst)
END_MSG_MAP



//tekst.h
#include <atlbase.h>
#include <atlapp.h>
#include <atlcrack.h>

class Tekst
{

BEGIN_MSG_MAP_EX(Tekst)
MSG_WM_PAINT(OnPaint)
END_MSG_MAP

void OnPaint(HDC hdc)
{
TextOut(hdc, 20, 20, "22",2);
SetMsgHandled(false);
}

};

When i compile :
error c2352 : 'Tekst ::processWindowMessage' : illegal call of non-static
memeber function.


I try to write some simple controls using WTL, so i want my class to be able
to manage messages in its own.
I believe i lack some knowledge, how to use chainmessages in WTL so i would
aprreciate for a piece of advice

Piotr Wojcicki
 
V

Victor Bazarov

Piotr Wójcicki said:
I want my class to draw on MainForm, when MainForm receives OnPaint Message
[...]

The error is likely due to improper use of some MFC (WTL) constructs,
which are off-topic here. Try comp.os.ms-windows.programmer.tools.mfc
or microsoft.public.vc.mfc newsgroups.
 
S

Simon Cooke

Piotr Wójcicki said:
I want my class to draw on MainForm, when MainForm receives OnPaint Message
[...]

The error is likely due to improper use of some MFC (WTL) constructs,
which are off-topic here. Try comp.os.ms-windows.programmer.tools.mfc
or microsoft.public.vc.mfc newsgroups.

Yes, it's offtopic. No, it has nothing to do with MFC.

WTL is unrelated to MFC. It's closely related to ATL, and is an extension
thereof.

For WTL support, go to groups.yahoo.com and subscribe to the wtl mailing
list. Or post in microsoft.public.vc.atl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top