Message Map Trouble 
Author Message
 Message Map Trouble

Hello,

    I am trying to override a windows message in a Windows Forms (.NET) App.
I am using the following code:

namespace Logger
{
 public __gc class AppWindow : public System::Windows::Forms::Form
 {

    private: int InputProc(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
    public:
      AppWindow(void)
     {
     InitializeComponent();
     }

  //  setup message handler
   BEGIN_MESSAGE_MAP(AppWindow)
     MESSAGE_HANDLER(WM_COPYDATA, InputProc);
   END_MESSAGE_MAP()

Quote:
};
};

.....The problem is I am getting a C3194 error :'class' : illegal use of
managed type 'object type'; did you forget a '*'?

Is it illegal to do this in this type of class, or am I apssing the wrong
argument to BEGIN_MESSSAGE_MAP?

-TGF



Wed, 07 Dec 2005 01:47:12 GMT  
 Message Map Trouble
This wouldn't work with a member function in a native class either. You need
to make it a static member in either case.

Ronald Laeremans
Visual C++ team


Quote:
> Hello,

>     I am trying to override a windows message in a Windows Forms (.NET)
App.
> I am using the following code:

> namespace Logger
> {
>  public __gc class AppWindow : public System::Windows::Forms::Form
>  {

>     private: int InputProc(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
> bHandled);
>     public:
>       AppWindow(void)
>      {
>      InitializeComponent();
>      }

>   //  setup message handler
>    BEGIN_MESSAGE_MAP(AppWindow)
>      MESSAGE_HANDLER(WM_COPYDATA, InputProc);
>    END_MESSAGE_MAP()

> };
> };

> .....The problem is I am getting a C3194 error :'class' : illegal use of
> managed type 'object type'; did you forget a '*'?

> Is it illegal to do this in this type of class, or am I apssing the wrong
> argument to BEGIN_MESSSAGE_MAP?

> -TGF



Thu, 08 Dec 2005 07:24:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. message maps / system messages

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

3. Adding user messages to a message map

4. How to add custom window message handler to MESSAGE MAP

5. how to insert my own message process function into message map

6. Trouble with STL map iterators...

7. I have trouble with Message of my own

8. Trouble posting thread messages

9. Trouble with Active X Keyboard messages

10. trouble sending messages to a DLL

11. Trouble with htmlview message NM_NAVIGATE

12. Troubles with "lvalue missing" error message

 

 
Powered by phpBB® Forum Software