C语言的函数格式与Delphi不同,它们是函数返回类型在前,函数声明在后.对于没有任何返回类型的函数则定义为VOID类型.
例如:Delphi中函数function MyFunction:(intIN:integer):Bool;相应的C语言代码就变成Bool MyFunction(int intIN);又例如procedure MyProcedure;====>void MyProcedure;采用这种方法,一般要求对C语言比较熟悉.我一般是采用这种方法.下面是我收集整理的自己常用的Delphi与C之间的类型对应 表.其中左边是C类型,右边是对应的Delphi类型
ABC -> TABC
ACCEL -> TAccel
ATOM -> TAtom
BITMAP -> TBitMap
BITMAPCOREHEADER -> TBitmapCoreHeader
BITMAPCOREINFO -> TBitmapCoreInfo
BITMAPFILEHEADER -> TBitmapFileHeader
BITMAPINFO -> TBitmapInfo
BITMAPINFOHEADER -> TBitmapInfoHeader
BOOL -> Bool
CBT_CREATEWND -> TCBT_CreateWnd
CBTACTIVATESTRUCT -> TCBTActivateStruct
CHAR -> Char
CHAR* -> PChar
CLIENTCREATESTRUCT -> TClientCreateStruct
COLORREF -> TColorRef
COMPAREITEMSTRUCT -> TCompareItemStruct
COMSTAT -> TComStat
CREATESTRUCT -> TCreateStruct
CTLINFO -> TCtlInfo
CTLSTYLE -> TCtlStyle
CTLtype -> TCtltype
DCB -> TDCB
DDEAACK -> TDDEAck
DDEADVISE -> TDDEAdvise
DDEDATA -> TDDEData
DDEPOKE -> TDDEPoke
DEBUGHOOKINFO -> TDebugHookInfo
DELETEITEMSTRUCT -> TDeleteItemStruct
DEVMODE -> TDevMode
DOUBLE -> Double
DRAWITEMSTRUCT -> TDrawItemStruct
DWORD -> LongInt
ENUMLOGFONT -> TEnumLogFont
EVENTMSG -> TEventMsg
FARPROC -> TFarProc
FIXED -> TFixed
FLOAT -> Single
GLYPHMETRICS -> TGlyphMetrics
HANDLE -> THandle
HANDLETABLE -> THandleTable
HARDWAREHOOKSTRUCT -> THardwareHookStruct
HELPWININFO -> THelpWinInfo
INT -> Integer
KERNINGPAIR -> TKerningPair
LOGBRUSH -> TLogBrush
LOGFONT -> TLogFont
LOGPALETTE -> TLogPalette
LOGPEN -> TLogPen
LONG -> LongInt
LONG DOUBLE -> Extended
LONG INT -> LongInt
LPSTR -> PChar
LPWSTR -> PWideChar
MAT2 -> TMat2
MDICREATESTRUCT -> TMDICreateStruct
MEASUREITEMSTRUCT -> TMeasureItemStruct
MENUITEMTEMPLATE -> TMenuItemTemplate
MENUITEMTEMPLATEHEADER -> TMenuItemTemplateHeader
METAFILEPICT -> TMetaFilePict
METAHEADER -> TMetaHeader
METARECORD -> TMetaRecord
MINMAXINFO -> TMinMaxInfo
MOUSEHOOKSTRUCT -> TMouseHookStruct
MSG -> TMsg
MULTIKEYHELP -> TMultiKeyHelp
NCCALCSIZE_PARAMS -> TNCCalcSize_Params
NEWTEXTMETRIC -> TNewTextMetric
OFSTRUCT -> TOFStruct
OUTLINETEXTMETRIC -> TOutlineTextMetric
PAINTSTRUCT -> TPaintStruct
PALETTEENTRY -> TPaletteEntry
PANOSE -> TPanose
PATTERN -> TPattern
POINTFX -> TPointFX
PSTR -> PChar
PWSTR -> PWideChar
RASTERIZER_STATUS -> TRasterizer_Status
RGBQUAD -> TRGBQuad
RGBTRIPLE -> TRGBTriple
SEGINFO -> TSegInfo
SHORT -> SmallInt
SHORT INT -> SmallInt
SIZE -> TSize
TEXTMETRIC -> TTextMetric
TPOINT -> TPoint
TRECT -> TRect
TTPOLYCURVE -> TTTPolyCurve
TTPOLYGONHEADER -> TPolygonHeader
UINT -> Word
UNSIGNED -> Word
UNSIGNED CHAR -> Byte
UNSIGNED INT -> Word
UNSIGNED LONG -> LongInt(DWORD)
UNSIGNED LONG INT -> LongInt
UNSIGNED SHORT -> Word
UNSIGNED SHORT INT -> Word
VOID* -> Pointer
WINDOWPLACEMENT -> TWindowPlacement
WINDOWPOS -> TWindowPos
WNDCLASS -> TWndClass
WORD -> Word