• Advertisement

Archived

This topic is now archived and is closed to further replies.

how can i use WndProc() in .NET applications?

This topic is 5188 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
ok i''ve tried to add this line at the .h file:
private: void WndProc( Message __gc* mess){}
but if i build the application i get this error:

error C3252: ''MyApp::MyWindows::WndProc'' : in a managed type you cannot reduce the accessibility to a virtual method

what means?

Share this post


Link to post
Share on other sites
ok i''ve resolved making it public.But now how can i get messages from windows?
Does it work like VC++ 6 or VC++.NET 2002?

Share this post


Link to post
Share on other sites
why do i get these error using this:

public: void WndProc( Message __gc* msg )
{
switch (msg->Msg)
{
case WM_NCACTIVATE :
textBox1->Text = S"attivato";
break;
}
Form::WndProc(msg);
}

errors:

error C2051: case expression not constant (at line "case WM_NCACTIVATE :")
error C2065: ''WM_NCACTIVATE'' : undeclared identifier (at the same line)
warning C4060: switch statement contains no ''case'' or ''default'' labels (at the last but one "}")


Share this post


Link to post
Share on other sites
i''ve resolved another time including "windows.h" but i''ve get much errors about the undefined object "GetObject" that i resolve is i put the line #undef GetObject, after the header, and other errors as:

error C2653: ''MessageBoxA'' : is not a class or namespace name
error C2660: ''System::Windows::Forms::Control::Show'' : function does not take 2 arguments

at the line:
MessageBox::Show(S"Hello World", S"Bye");

the question is, why i need to include that header to use WM_ ?
and why if i just include it i get these errors?
At the end why using #undef i resolve one?

Share this post


Link to post
Share on other sites

  • Advertisement