问题描述
- c++builder 添加类的问题
- .h代码:
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include
#include
#include
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent Owner);
};
class Show : public TForm1
{
public:
__fastcall show();private:
} ;
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
——————————————————————————
.cpp代码
#include
#pragma hdrstop#include ""Unit1.h""
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource ""*.dfm""
TForm1 Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent Owner)
: TForm(Owner)
{
}
__fastcall Show :: show()
{
ShowMessage(""sssss"");}
//---------------------------------------------------------------------------void __fastcall Show::Button1Click(TObject *Sender)
{
show();
}
c++ builder初学者(胆大!) 该怎么添加一个类,帮忙改一改,谢谢
错误提示:
解决方案
.h代码
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include
#include
#include
#include
.cpp代码
#include
#pragma hdrstop
#include ""Unit1.h""
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource ""*.dfm""
TForm1 *Form1;
开头没显示?在这补上
解决方案二:
........#include后边不能显示怎么回事?
解决方案三:
c++builder添加版本信息
解决方案四:
http://www.cnblogs.com/xiangzi888/archive/2012/04/16/2451947.html