a1103193859 2015-12-09 13:52 采纳率: 33.3%
浏览 1565

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初学者(胆大!) 该怎么添加一个类,帮忙改一改,谢谢
错误提示:图片说明

  • 写回答

3条回答 默认 最新

  • a1103193859 2015-12-09 13:59
    关注

    .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;
    开头没显示?在这补上

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器