|
폼1안에 마우스 커서가 들어가면 캡션에 hi라고 뜰고
폼1밖으로 마우스 커서가 나오면 캡션에 bye라고 뜨게하는 프로그램
각각 하나씩 프로그램하면 동작이 됩니다.
unit1.cpp
void __fastcall TForm1::CMMouseEnter(TMessage &Message)
{
this -> Caption = "Hi";
}
void __fastcall TForm1::CMMouseLeave(TMessage &Message)
{
this -> Caption = "bye";
}
unit1.h
private:
void __fastcall CMMouseEnter(TMessage &Message);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(CM_MOUSEENTER, TMessage, CMMouseEnter)
END_MESSAGE_MAP (TForm)
void __fastcall CMMouseLeave(TMessage &Message);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(CM_MOUSELEAVE, TMessage, CMMouseLeave)
END_MESSAGE_MAP (TForm)
오류 내용
[C++ Error] Unit1.h(21): E2238 Multiple declaration for '_fastcall TForm1::Dispatch(void *)'
밑에 있는 BEGIN_MESSAGE_MAP
[C++ Error] Unit1.h(16): E2344 Earlier declaration of '_fastcall TForm1::Dispatch(void *)'
위에 있는 BEGIN_MESSAGE_MAP
|