class function TDDFVendors.GetGlobalRef: TCustomDropDownFormEh;
begin
if DDFVendors = nil then
Application.CreateForm(TDDFVendors, DDFVendors);
Result := DDFVendors;
end;
如題。。。感謝。。。
另外,我在CB中創建了兩個表單,在主表單中宣告一個子表單型別的變數,報錯:“Type Name Expected”,不知是何原因?,已包含子表單頭檔案,主表單頭檔案如下:
//---------------------------------------------------------------------------
#ifndef ddf_commodity_categoryH
#define ddf_commodity_categoryH
//---------------------------------------------------------------------------
#include "f_commodity_category.h"
#include "DBConsts.hpp"
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ADODB.hpp>
#include <Buttons.hpp>
#include <DB.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include "BusinessSkinForm.hpp"
#include "DBAxisGridsEh.hpp"
#include "DBGridEh.hpp"
#include "DBGridEhGrouping.hpp"
#include "DBGridEhToolCtrls.hpp"
#include "DBVertGridsEh.hpp"
#include "DynVarsEh.hpp"
#include "GridsEh.hpp"
#include "ToolCtrlsEh.hpp"
#include "DropDownFormEh.hpp"
#include "ADODataDriverEh.hpp"
#include "DataDriverEh.hpp"
#include "MemTableDataEh.hpp"
#include "MemTableEh.hpp"
//---------------------------------------------------------------------------
class TDdfCommodityCategory : public TCustomDropDownFormEh
{
__published: // IDE-managed Components
TSplitter *Splitter1;
TPanel *Panel2;
TDBGridEh *dbgrdeh_1;
TPanel *Panel3;
TSpeedButton *SpeedButton3;
TSpeedButton *SpeedButton4;
TSpeedButton *SpeedButton5;
TImage *Image1;
TDBVertGridEh *DBVertGridEh1;
TPanel *Panel1;
TSpeedButton *sbOk;
TSpeedButton *SpeedButton2;
TDataSource *dtsc_1;
TADOQuery *adoqry_1;
TbsBusinessSkinForm *bs_sknfm_1;
void __fastcall CustomDropDownFormEhInitForm(TCustomDropDownFormEh *Sender, TDynVarsEh *DynParams);
void __fastcall CustomDropDownFormEhReturnParams(TCustomDropDownFormEh *Sender, TDynVarsEh *DynParams);
void __fastcall sbOkClick(TObject *Sender);
void __fastcall SpeedButton2Click(TObject *Sender);
void __fastcall SpeedButton3Click(TObject *Sender);
void __fastcall SpeedButton4Click(TObject *Sender);
void __fastcall SpeedButton5Click(TObject *Sender);
void __fastcall CustomDropDownFormEhCreate(TObject *Sender);
private: // User declarations
public: // User declarations
class TDdfCommodityCategory(TComponent* Owner);
//GetGlobalRef();
TFCommodityCategory *VFCommodityCategory;//就是這里出錯鳥
};
//---------------------------------------------------------------------------
extern PACKAGE TDdfCommodityCategory *DdfCommodityCategory;
//---------------------------------------------------------------------------
#endif
uj5u.com熱心網友回復:
大家來看看哦。。。uj5u.com熱心網友回復:
TCustomDropDownFormEh* TDDFVendors::GetGlobalRef()
{
if(!DDFVendors)
Application.CreateForm(TDDFVendors, DDFVendors);
return DDFVendors;
}
uj5u.com熱心網友回復:
/head
__classmethod virtual TCustomDropDownFormEh* __fastcall GetGlobalRef();
//cpp
TCustomDropDownFormEh* __fastcall TForm19::GetGlobalRef ()
{
if (DDFVendors == NULL)
Application->CreateForm(__classid(TDDFVendors), &DDFVendors);
return DDFVendors;
}
uj5u.com熱心網友回復:
TCustomDropDownFormEh* __fastcall TDDFVendors::GetGlobalRef ()
{
if (DDFVendors == NULL)
Application->CreateForm(__classid(TDDFVendors), &DDFVendors);
return DDFVendors;
}
uj5u.com熱心網友回復:
TFCommodityCategory在哪里定義的在#include "f_commodity_category.h"頭檔案里嗎
uj5u.com熱心網友回復:
public: // User declarations__fastcall TDdfCommodityCategory(TComponent* Owner);
TFCommodityCategory *VFCommodityCategory // 這個 TFCommodityCategory 類在哪個 .h 或 .hpp
};
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/119900.html
標籤:基礎類
上一篇:類模板特化與片特化問題
