Jak zdefiniować typ A w typie B i typ B w typie A?
Mam dwa typy. Jeden typ A i jeden typ B. Problem typu A zawiera typ B, a typ B zawiera typ A. Taka rzecz nie zadziała:
type
typeA = record
test1 : typeB;
end;
type
typeB = record
test2 : typeA;
end;
Edytować: To nie mój projekt. Konwertuję pliki nagłówka C (aby uzyskać dostęp do biblioteki DLL), które zawierają takie konstrukcje do delphi.
Edit2: „Struktury C ++ to inna nazwa klas AFAIR. I musiały istnieć wskaźniki, a nie same wartości. - Arioch 'The 1 min ago” Tak, masz rację, że był to wskaźnik do typu:
Zdefiniowałem:
test1 : ^typeB;
Czy to zadziała?
test1 : Pointer;
Edit3: The C Structs:
/* DLPDFPAGE */
typedef struct dlpdfpage
{
CosObj Page;
CosObj PrintSelect;
ASFixedRect PageBBox;
ASFixedRect ContentBBox;
struct dlpdfpage *Next;
PDRotate Angle;
struct dlpdfdoc *Doc;
DLPDFSTREAM *Content;
long PageNumber;
char Complete;
char FontSubstituted;
char FontMM;
char FontBad;
} DLPDFPAGE;
/* DLPDFDOC */
typedef struct dlpdfdoc
{
DLPDFINSTANCE *dliInstance;
PDDoc pdDoc;
CosDoc cosDoc;
DLPDFOUTLINE *Outlines;
char *PDFFileName;
char *PDFPostFileName;
DLPOS LastPageEnd;
DLPOS BeforeDef;
ASFixedRect DocBBox;
long PageCount;
long PageTreeWidth;
long PageTreeDepth;
long PageTreeDepthUsed;
DLPDFPAGETREEARRAY *AllPages;
DLPDFFONTLIST *AllFonts;
DLPDFFORMLIST *AllForms;
DLPDFFORMLIST *AllColors;
DLPDFIMAGELIST *AllImages;
DLPDFSPOTCOLORLIST *AllSpotColors;
DLPDFSPOTCOLORLIST *AllPatterns;
DLPDFEXTGSTATELIST *AllExtGStates;
DLPDFPAGE *PageList;
DLPDFPAGE *LastPage;
DLPDFDEST *DeferedDests;
DLPDFSIGNATURE *signatureHolder;
struct dlpdfacroform *AcroFormBase;
CosObj PatternColorObj,
PatternColorRGBObj,
PatternColorCMYKObj,
PatternColorGrayObj,
PrintSelect,
PrintSelectCriteria;
CosObj IdentH, IdentV;
ASAtom DocumentEncoding;
long FontCount;
long FormCount;
long PatCount;
long ImageCount;
char Compress;
char Linearize;
char PageTreeComplete;
char EmbedFonts;
char PatternColorsDefined;
char MakeThumbNails;
ASBool psSevenBitSafe;
ASInt32 EncryptKeyByteCount;
char condenseResDicts;
CosObj resourceDict;
ASInt16 pdfMajorVer;
ASInt16 pdfMinorVer;
DLPDFINCLUDEDRES *InclRes;
DLPDFSPOTCOLORLIST *AllShadings;
long ShadeCount;
} DLPDFDOC;