chrisliando
Newcomer
- Joined
- Feb 17, 2008
- Messages
- 6
(1)
What is Project::Subclass::NativeWindowsEvent and how to use it?
I've got codes in old C++ syntax and I want to change it to the new one.
// ===================================================================
// NativeWindow Subclassing
// ===================================================================
ref class Subclass : public System::Windows::Forms::NativeWindow
{
public:
delegate void WindowsEventHandler(Object ^sender, Message ^uMsg);
event WindowsEventHandler ^NativeWindowsEvent;
Subclass(IntPtr pWindowHandle)
{
this->AssignHandle(pWindowHandle);
}
void SendWndProc( System::Windows::Forms::Message ^uMsg )
{
//super::WndProc(uMsg);
}
protected: void WndProc( System::Windows::Forms::Message ^uMsg )
{
//__super::WndProc(uMsg);
if ( Project::Subclass::NativeWindowsEvent != nullptr )
Project::Subclass::NativeWindowsEvent(this, uMsg);
}
};
When I compiled it, the error message was:
Error C3918: usage requires 'Project::Subclass::NativeWindowsEvent' to be a data member
see declaration of 'Project::Subclass::NativeWindowsEvent'
How to change it to the new C++ syntax?
(2)
What is "__super" in old C++ syntax converted to new C++ syntax?
Thank you very much.
What is Project::Subclass::NativeWindowsEvent and how to use it?
I've got codes in old C++ syntax and I want to change it to the new one.
// ===================================================================
// NativeWindow Subclassing
// ===================================================================
ref class Subclass : public System::Windows::Forms::NativeWindow
{
public:
delegate void WindowsEventHandler(Object ^sender, Message ^uMsg);
event WindowsEventHandler ^NativeWindowsEvent;
Subclass(IntPtr pWindowHandle)
{
this->AssignHandle(pWindowHandle);
}
void SendWndProc( System::Windows::Forms::Message ^uMsg )
{
//super::WndProc(uMsg);
}
protected: void WndProc( System::Windows::Forms::Message ^uMsg )
{
//__super::WndProc(uMsg);
if ( Project::Subclass::NativeWindowsEvent != nullptr )
Project::Subclass::NativeWindowsEvent(this, uMsg);
}
};
When I compiled it, the error message was:
Error C3918: usage requires 'Project::Subclass::NativeWindowsEvent' to be a data member
see declaration of 'Project::Subclass::NativeWindowsEvent'
How to change it to the new C++ syntax?
(2)
What is "__super" in old C++ syntax converted to new C++ syntax?
Thank you very much.