A
artx
Unregistered / Unconfirmed
GUEST, unregistred user!
我在bcb2006 中写一个新的OpenDialog,从vcl TOpenDialog继承,系统生成的代码如下:
//**************************************************************************
OpenDialog1.hpp代码:
#ifndef OpenDialog1H
#define OpenDialog1H
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
class PACKAGE TMyOpenDialog : public TOpenDialog
{
private:
protected:
public:
__fastcall TMyOpenDialog(TComponent* Owner);
__published:
};
//---------------------------------------------------------------------------
#endif
OpenDialog1.cpp代码:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "OpenDialog1.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components createddo
not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TMyOpenDialog *)
{
new TMyOpenDialog(NULL);
}
//---------------------------------------------------------------------------
__fastcall TMyOpenDialog::TMyOpenDialog(TComponent* Owner)
: TOpenDialog(Owner)
{
}
//---------------------------------------------------------------------------
namespace Opendialog1
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TMyOpenDialog)};
RegisterComponents("Samples", classes, 0);
}
}
//**************************************************************************
以上代码Build就出现Link Error:
[Linker Error] Error: Unresolved external '__fastcall Dialogs::TOpenDialog::Execute(void *)' referenced from C:/DOCUMENTS AND SETTINGS/ADMIN.ARTX/MYdo
CUMENTS/BORLAND STUDIO PROJECTS/DEBUG_BUILD/OPENDIALOG1.OBJ
我用同样的做法却在BCB6中顺利通过,请问BCB2006中怎么会出现这个问题,该怎么解决?
谢谢!
//**************************************************************************
OpenDialog1.hpp代码:
#ifndef OpenDialog1H
#define OpenDialog1H
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
class PACKAGE TMyOpenDialog : public TOpenDialog
{
private:
protected:
public:
__fastcall TMyOpenDialog(TComponent* Owner);
__published:
};
//---------------------------------------------------------------------------
#endif
OpenDialog1.cpp代码:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "OpenDialog1.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components createddo
not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TMyOpenDialog *)
{
new TMyOpenDialog(NULL);
}
//---------------------------------------------------------------------------
__fastcall TMyOpenDialog::TMyOpenDialog(TComponent* Owner)
: TOpenDialog(Owner)
{
}
//---------------------------------------------------------------------------
namespace Opendialog1
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TMyOpenDialog)};
RegisterComponents("Samples", classes, 0);
}
}
//**************************************************************************
以上代码Build就出现Link Error:
[Linker Error] Error: Unresolved external '__fastcall Dialogs::TOpenDialog::Execute(void *)' referenced from C:/DOCUMENTS AND SETTINGS/ADMIN.ARTX/MYdo
CUMENTS/BORLAND STUDIO PROJECTS/DEBUG_BUILD/OPENDIALOG1.OBJ
我用同样的做法却在BCB6中顺利通过,请问BCB2006中怎么会出现这个问题,该怎么解决?
谢谢!