Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   C++ Jedi in C++: TJvInspectorTypeInfoRegItem (https://www.delphipraxis.net/143180-jedi-c-tjvinspectortypeinforegitem.html)

JaySus 11. Nov 2009 11:29


Jedi in C++: TJvInspectorTypeInfoRegItem
 
Hi,

Wie kann ich folgendes in C++ (RAD 2009) übersetzen?
Delphi-Quellcode:
TJvCustomInspectorData.ItemRegister.Add(TJvInspectorTypeInfoRegItem.Create(TJvInspectorLicenseItem, TypeInfo(AnsiString)));
Ich habe folgendes versucht:
Code:
TJvCustomInspectorData::ItemRegister()->Add(new TJvInspectorTypeInfoRegItem(__classid(TJvInspectorLicenseItem), TypeInfo(AnsiString)));
Der Compilier meckert endlich nicht, dafür aber der Linker:
Zitat:

[ILINK32 Fehler] Error: Nicht auflösbares externes '__fastcall Jvinspector::TJvInspectorTypeInfoRegItem::TJvInspe ctorTypeInfoRegItem(System::TMetaClass * const, Typinfo::TTypeInfo *)' referenziert von ...\DEBUG\UNITFORMMAIN.OBJ
Meine Klasse wäre dies:
Code:
class TJvInspectorLicenseItem : public TJvInspectorStringItem
{
protected:
  void __fastcall Edit()
  {
    ShowMessage("Juhu");
    Data->AsString = "test";
  };
  String __fastcall GetDisplayValue()
  {
    if (Data->AsString.Length() == 0)
      return "(Klicken zum Importieren!)";
    else
      return "(Lizenz vorhanden)";
  };
public:
  __fastcall TJvInspectorLicenseItem(const TJvCustomInspectorItem* AParent, const TJvCustomInspectorData* AData)
      : TJvInspectorStringItem(AParent, AData)
  {
    Flags = Flags << iifEditButton << iifEditFixed;
  };
};
Was ich erreichen will, ist, dass meine Klasse registriert wird und ich folgendes verwenden darf:
Code:
item = TJvInspectorVarData::New(cat, "Lizenz", TypeInfo(TJvInspectorLicenseItem), &(FConfig.License));
Das C++-Beispiel bei den Examples behandelt leider diesen Abschnitt nicht.

Gruß
//Jay


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz