注册 登录
编程论坛 C++ Builder

请问如何修改?

flaght 发布于 2007-07-04 12:37, 1446 次点击

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
TForm1::WndProc(TMessage &Message);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}


void_fastcall TForm1::WndProc(TMessage &Message)
{

switch(Message.msg)
{
case WM_WINDONWPSCHAGING:
if (LPWINDOWPOS(Message.LParam)->y<20)
LPWINDOWPOS(Message.LParam)->y=0;
if (LPWINDOWPOS(Message.LParam)->x<100)
LPWINDOWPOS(Message.LParam)->x=0;
break;

}
TForm1::WndProc(Message);
}

错误:
[C++ Error] Unit1.cpp(11): E2316 'TForm1::WndProc(TMessage &)' is not a member of 'TForm1'
[C++ Error] Unit1.cpp(19): E2141 Declaration syntax error

1 回复
#2
IPV62007-08-24 08:40
在头文件中声明一下WndProc函数
1