User defined messages.. 
Author Message
 User defined messages..

Hi everyone,

Can any one tell me how to generate a user defined message in ATL.
I want to generate a User-defined messages in ATL. I did one sample but its
not working.

regards,
Ravi

--
S.Venkata Ravi Kumar
eLogic Solutions



Sat, 25 Jun 2005 14:16:37 GMT  
 User defined messages..

Quote:
>Can any one tell me how to generate a user defined message in ATL.
>I want to generate a User-defined messages in ATL. I did one sample but its
>not working.

Ravi,

Are you talking about a Windows message:

#define MYMESSAGE WM_APP+1

... or something else?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Sat, 25 Jun 2005 17:28:45 GMT  
 User defined messages..

Hi Dave,

Yes I want the windows message itself..

I want the same thing like this only #define MYMESSAGE WM_APP+1

Ravi


Quote:
> >Can any one tell me how to generate a user defined message in ATL.
> >I want to generate a User-defined messages in ATL. I did one sample but
its
> >not working.

> Ravi,

> Are you talking about a Windows message:

> #define MYMESSAGE WM_APP+1

> ... or something else?

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq



Sun, 26 Jun 2005 12:42:55 GMT  
 User defined messages..

Quote:
>Yes I want the windows message itself..

>I want the same thing like this only #define MYMESSAGE WM_APP+1

Hi Ravi,

I don't know if there's a language problem here, but I'm totally
confused over what you need to know.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Sun, 26 Jun 2005 17:51:58 GMT  
 User defined messages..
Hi Dave,

Sorry for not making it clear.

I wanna use a user defined message in my ATL application.

I want to post my own message.
I did like the following way..

#define WM_STARTRECORDING (WM_USER+100)
//in the message map

BEGIN_MSG_MAP(CRecord)

MESSAGE_HANDLER(WM_STARTRECORDING,OnStartRecording)

END_MSG_MAP()

LRESULT OnStartRecording(WPARAM w, LPARAM p)

{

MessageBox(NULL,"start recording","Record",MB_OK);

Quote:
}

But I m not able to build this code..  I m getting  error's

So please can you tell me how to do this in ATL ?? I did this in MFC by
changing the macro ..it worked fine ..

Please kindly reply me ..
thanking you,
Ravi

Quote:
----- Original Message -----

Newsgroups: microsoft.public.vc.atl
Sent: Wednesday, January 08, 2003 3:21 PM
Subject: Re: User defined messages..

> >Yes I want the windows message itself..

> >I want the same thing like this only #define MYMESSAGE WM_APP+1

> Hi Ravi,

> I don't know if there's a language problem here, but I'm totally
> confused over what you need to know.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq



Sun, 26 Jun 2005 18:22:28 GMT  
 User defined messages..
Hi Ravi,

The signature for message handlers should be:

LRESULT OnStartRecording(UINT uMsg, WPARAM w, LPARAM p, BOOL& bHandled)

Hope that helps,

--
Kim Gr?sman, Visual C++ MVP
http://www.winwonk.com


Quote:
> Hi Dave,

> Sorry for not making it clear.

> I wanna use a user defined message in my ATL application.

> I want to post my own message.
> I did like the following way..

> #define WM_STARTRECORDING (WM_USER+100)
> //in the message map

> BEGIN_MSG_MAP(CRecord)

> MESSAGE_HANDLER(WM_STARTRECORDING,OnStartRecording)

> END_MSG_MAP()

> LRESULT OnStartRecording(WPARAM w, LPARAM p)

> {

> MessageBox(NULL,"start recording","Record",MB_OK);

> }

> But I m not able to build this code..  I m getting  error's

> So please can you tell me how to do this in ATL ?? I did this in MFC by
> changing the macro ..it worked fine ..

> Please kindly reply me ..
> thanking you,
> Ravi

> ----- Original Message -----

> Newsgroups: microsoft.public.vc.atl
> Sent: Wednesday, January 08, 2003 3:21 PM
> Subject: Re: User defined messages..

> > >Yes I want the windows message itself..

> > >I want the same thing like this only #define MYMESSAGE WM_APP+1

> > Hi Ravi,

> > I don't know if there's a language problem here, but I'm totally
> > confused over what you need to know.

> > Dave
> > --
> > MVP VC++ FAQ: http://www.mvps.org/vcfaq



Sun, 26 Jun 2005 20:24:17 GMT  
 User defined messages..
I did change the function as you told. But when I compile the code I m
getting the following error

"error LNK2001: unresolved external symbol "public: long __thiscall
CRecord::OnStartRecording(unsigned int,unsigned int,long,int &)"

can you please tell me where I have gone wrong ??

thanking you,
Ravi

Quote:
> Hi Ravi,

> The signature for message handlers should be:

> LRESULT OnStartRecording(UINT uMsg, WPARAM w, LPARAM p, BOOL& bHandled)

> Hope that helps,

> --
> Kim Gr?sman, Visual C++ MVP
> http://www.winwonk.com



> > Hi Dave,

> > Sorry for not making it clear.

> > I wanna use a user defined message in my ATL application.

> > I want to post my own message.
> > I did like the following way..

> > #define WM_STARTRECORDING (WM_USER+100)
> > //in the message map

> > BEGIN_MSG_MAP(CRecord)

> > MESSAGE_HANDLER(WM_STARTRECORDING,OnStartRecording)

> > END_MSG_MAP()

> > LRESULT OnStartRecording(WPARAM w, LPARAM p)

> > {

> > MessageBox(NULL,"start recording","Record",MB_OK);

> > }

> > But I m not able to build this code..  I m getting  error's

> > So please can you tell me how to do this in ATL ?? I did this in MFC by
> > changing the macro ..it worked fine ..

> > Please kindly reply me ..
> > thanking you,
> > Ravi

> > ----- Original Message -----

> > Newsgroups: microsoft.public.vc.atl
> > Sent: Wednesday, January 08, 2003 3:21 PM
> > Subject: Re: User defined messages..

> > > >Yes I want the windows message itself..

> > > >I want the same thing like this only #define MYMESSAGE WM_APP+1

> > > Hi Ravi,

> > > I don't know if there's a language problem here, but I'm totally
> > > confused over what you need to know.

> > > Dave
> > > --
> > > MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 27 Jun 2005 22:12:55 GMT  
 User defined messages..
You've changed the signature in the declaration, but forgot to do that
in the implementation. Change it in all places where OnStartRecording
appears
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I did change the function as you told. But when I compile the code I m
> getting the following error

> "error LNK2001: unresolved external symbol "public: long __thiscall
> CRecord::OnStartRecording(unsigned int,unsigned int,long,int &)"

> can you please tell me where I have gone wrong ??

> thanking you,
> Ravi


> > Hi Ravi,

> > The signature for message handlers should be:

> > LRESULT OnStartRecording(UINT uMsg, WPARAM w, LPARAM p, BOOL&
bHandled)

> > Hope that helps,

> > --
> > Kim Gr?sman, Visual C++ MVP
> > http://www.winwonk.com



> > > Hi Dave,

> > > Sorry for not making it clear.

> > > I wanna use a user defined message in my ATL application.

> > > I want to post my own message.
> > > I did like the following way..

> > > #define WM_STARTRECORDING (WM_USER+100)
> > > //in the message map

> > > BEGIN_MSG_MAP(CRecord)

> > > MESSAGE_HANDLER(WM_STARTRECORDING,OnStartRecording)

> > > END_MSG_MAP()

> > > LRESULT OnStartRecording(WPARAM w, LPARAM p)

> > > {

> > > MessageBox(NULL,"start recording","Record",MB_OK);

> > > }

> > > But I m not able to build this code..  I m getting  error's

> > > So please can you tell me how to do this in ATL ?? I did this in
MFC by
> > > changing the macro ..it worked fine ..

> > > Please kindly reply me ..
> > > thanking you,
> > > Ravi

> > > ----- Original Message -----

> > > Newsgroups: microsoft.public.vc.atl
> > > Sent: Wednesday, January 08, 2003 3:21 PM
> > > Subject: Re: User defined messages..

> > > > >Yes I want the windows message itself..

> > > > >I want the same thing like this only #define MYMESSAGE WM_APP+1

> > > > Hi Ravi,

> > > > I don't know if there's a language problem here, but I'm totally
> > > > confused over what you need to know.

> > > > Dave
> > > > --
> > > > MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 27 Jun 2005 22:50:31 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. User defined messages and the message loop

2. handling user-defined messages (WM_USER) with message maps

3. User define message is lost in the thread!!!

4. user defined messages

5. User defined messages in Release

6. User defined messages only for mainfrm?

7. Sending a user defined message

8. How to send User defined Message between CMDIChildWnd?

9. Catching user-defined messages

10. Sending User defined messages

11. help adding user defined message

12. User defined message part.3

 

 
Powered by phpBB® Forum Software