关于UINT的错误,想在今晚得到答案
程序如下:
//Unit1.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: void __fastcall MyBeep(UINT uType); // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
//Unit.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall MyBeep(UINT uBeep)
{
for(int i;i<800;i++)
{
MessageBeep(uBeep);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
MyBeep(0xFFFFFFFF);
}
//---------------------------------------------------------------------------
错误如下:
[Linker Error] Unresolved external '__fastcall TForm1::MyBeep(unsigned int)' referenced from D:\PROGRAM FILES\BORLAND\CBUILDER5\PROJECTS\UNIT1.OBJ
估计是UINT的错误,可不清楚错误在哪里,希望能尽快得到答案。谢了