C++Builder 2010 自制组件,连接错误,问题在哪里?
//---------------------------------------------------------------------------#ifndef TTestComponentH
#define TTestComponentH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
//---------------------------------------------------------------------------
class PACKAGE TTestComponent : public TComponent
{
private:
TButton *f_button;
protected:
public:
__fastcall TTestComponent(TComponent* Owner);
__published:
__property TButton *Button= {read=f_button,write =f_button };
};
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "TTestComponent.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TTestComponent *)
{
new TTestComponent(NULL);
}
//---------------------------------------------------------------------------
__fastcall TTestComponent::TTestComponent(TComponent* Owner)
: TComponent(Owner)
{
}
//---------------------------------------------------------------------------
namespace Ttestcomponent
{
void __fastcall PACKAGE Register()
{
TComponentClass classes = {__classid(TTestComponent)};
RegisterComponents(L"MyTestComponent", classes, 0);
}
}
//---------------------------------------------------------------------------
点击此处下载 ourdev_576739.rar(文件大小:4.07M) (原文件名:MyTestComponent.rar) 继续问。
页:
[1]