13,825
社区成员
发帖
与我相关
我的任务
分享
#ifndef Unit3H
#define Unit3H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TMyForm : public TForm
{
typedef TForm inherited;
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TMyForm(TComponent* Owner);
void __fastcall ShowStr(AnsiString Str);
};
//---------------------------------------------------------------------------
extern PACKAGE TMyForm *MyForm;
//---------------------------------------------------------------------------
#endif
#include <vcl.h>
#pragma hdrstop
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMyForm *MyForm;
//---------------------------------------------------------------------------
__fastcall TMyForm::TMyForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMyForm::ShowStr(AnsiString Str)
{
ShowMessage(Str);
}
//---------------------------------------------------------------------------
void __fastcall PACKAGE Register()
{
// Make sure that, as part of the startup
// code, the streaming classes are registered
// with the streaming system.
#pragma startup Register
Classes::RegisterClass(__classid(TMyForm));
}
//---------------------------------------------------------------------------
//Unit3.h
#ifndef Unit3H
#define Unit3H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TMyForm : public TForm
{
typedef TForm inherited;
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TMyForm(TComponent* Owner);
void __fastcall ShowStr(AnsiString Str);
};
//---------------------------------------------------------------------------
extern PACKAGE TMyForm *MyForm;
//---------------------------------------------------------------------------
#endif
//Unit3.cpp
#include <vcl.h>
#pragma hdrstop
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMyForm *MyForm;
//---------------------------------------------------------------------------
__fastcall TMyForm::TMyForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMyForm::ShowStr(AnsiString Str)
{
ShowMessage(Str);
}
//---------------------------------------------------------------------------
void __fastcall PACKAGE Register()
{
// Make sure that, as part of the startup
// code, the streaming classes are registered
// with the streaming system.
#pragma startup Register
Classes::RegisterClass(__classid(TMyForm));
}
//---------------------------------------------------------------------------
void __fastcall PACKAGE Register()
{
// Make sure that, as part of the startup
// code, the streaming classes are registered
// with the streaming system.
#pragma startup Register
Classes::RegisterClass(__classid(TMyForm));
}