Z zanpen2001 Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #1 怎样知道一个API函数在Delphi中属于哪个单元?比如WinExec函数,<br>NetMessageBufferSend函数等。我要查的话应该怎样去查?如果Delphi中没有<br>封装某个API函数,而我又想用它,怎么做?
怎样知道一个API函数在Delphi中属于哪个单元?比如WinExec函数,<br>NetMessageBufferSend函数等。我要查的话应该怎样去查?如果Delphi中没有<br>封装某个API函数,而我又想用它,怎么做?
Y yzhshi Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #2 可以查找呀。<br>利用Windows的查找,选择包含的文字,然后输入你要的Api函数,在Delphi的目录下查找pas文件就可以了。<br>
卷 卷起千堆雪tyn Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #3 2种方法:<br><br>1、选中你要看的函数,按F1;<br>2、按下Ctrl键的同时点击你要看的函数
Y yzhshi Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #4 如果Delphi没有声明,那就需要自己动手声明了。<br>可以看Microsoft 的SDK的声明,那时VC的声明,照葫芦画瓢,改成Delphi的就可以了。
V vine Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #5 按下Ctrl键的同时点击你要看的函数<br><br>单元名就在新出现的page上了
T tan_jian Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #7 多半在ShellApi,commctrl,shlobj,activex,windows等下,<br>或通过windows自己查找
Z zbwsh Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #8 看帮助,delphi声明过的在它的帮助windows sdk help 中一般都有,<br>再看帮助中的quick info,单元名称一般与c的头文件相同。
Z zanpen2001 Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #10 TO yzhshi:这里有一个函数,我有些问题不明白。<br>interface<br>...<br>function NetMessageBufferSend(servernameWideChar;<br> MsgNameWideChar;<br> FromNameWideChar;<br> Buf: PWideChar;<br> var BufLen:integer):integer;cdecl;<br>....<br>implementation<br>function NetMessageBufferSend; external 'netapi32.dll' name 'NetMessageBufferSend';<br>.....<br>以上是在Delphi中的声明,下面是在SDK中的声明:<br>NET_API_STATUS NetMessageBufferSend(<br> LPTSTR servername, <br> LPTSTR msgname, <br> LPTSTR fromname, <br> LPBYTE buf, <br> DWORD buflen <br> <br>我不明白的地方是: A、LPTSTR、LPBYTE、DWORD都是对应Delphi中的什么数据类型?除了<br> 这些,还能详细解释一下其它对应的数据类型吗?或者告诉我得知<br> 对应的这些数据类型的方法就更好了。<br> B、同样的都是PWideChar,为什么在调用这个函数时有的函数前面要<br> 加"@"?是不是缓冲区变量前都要加?<br> 比如下面这个调用:NetMessageBufferSend(nil,ToName,nil,@WMsgText,MsgLen); <br> 变量声明为:var ToName :array [0..64] of WideChar;<br> WMsgText:array [0..1000] of WideChar; <br> 解释得越详细越好,这个问题已经困扰我好长时间了 :( <br> C、给数组ToName、WMsgText赋值时,用的是For i:=0 to 64 do ToName:=#0;<br> For i:=0 to 1000 do WmsgText:=#0;<br> 请问后面的"#0"是什么意思?看了帮助了,E文太差,不明白。解释一下吧!<br> <br> 各位多费心,帮我弄明白吧,学Delphi这么久,也当了这么久的糊涂虫,现在想清醒一下,<br>帮帮我吧! <br><br>
TO yzhshi:这里有一个函数,我有些问题不明白。<br>interface<br>...<br>function NetMessageBufferSend(servernameWideChar;<br> MsgNameWideChar;<br> FromNameWideChar;<br> Buf: PWideChar;<br> var BufLen:integer):integer;cdecl;<br>....<br>implementation<br>function NetMessageBufferSend; external 'netapi32.dll' name 'NetMessageBufferSend';<br>.....<br>以上是在Delphi中的声明,下面是在SDK中的声明:<br>NET_API_STATUS NetMessageBufferSend(<br> LPTSTR servername, <br> LPTSTR msgname, <br> LPTSTR fromname, <br> LPBYTE buf, <br> DWORD buflen <br> <br>我不明白的地方是: A、LPTSTR、LPBYTE、DWORD都是对应Delphi中的什么数据类型?除了<br> 这些,还能详细解释一下其它对应的数据类型吗?或者告诉我得知<br> 对应的这些数据类型的方法就更好了。<br> B、同样的都是PWideChar,为什么在调用这个函数时有的函数前面要<br> 加"@"?是不是缓冲区变量前都要加?<br> 比如下面这个调用:NetMessageBufferSend(nil,ToName,nil,@WMsgText,MsgLen); <br> 变量声明为:var ToName :array [0..64] of WideChar;<br> WMsgText:array [0..1000] of WideChar; <br> 解释得越详细越好,这个问题已经困扰我好长时间了 :( <br> C、给数组ToName、WMsgText赋值时,用的是For i:=0 to 64 do ToName:=#0;<br> For i:=0 to 1000 do WmsgText:=#0;<br> 请问后面的"#0"是什么意思?看了帮助了,E文太差,不明白。解释一下吧!<br> <br> 各位多费心,帮我弄明白吧,学Delphi这么久,也当了这么久的糊涂虫,现在想清醒一下,<br>帮帮我吧! <br><br>
Y yzhshi Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #11 实话说,我没有自己写过动态库在Delphi里面的声明,不过,我还是有一个办法来解决这个问题。<br>你可以找在Delphi里面已经声明了的函数来学习,根据SDK里面对他们的声明和Delphi里面的声明<br>来找出其对应关系。<br>哎,我也应该弄清楚一些了,我在这方面也是糊涂虫!<br>现在人在外地,等过两天回单位,一定要仔细研究一下各种对应关系。[]
实话说,我没有自己写过动态库在Delphi里面的声明,不过,我还是有一个办法来解决这个问题。<br>你可以找在Delphi里面已经声明了的函数来学习,根据SDK里面对他们的声明和Delphi里面的声明<br>来找出其对应关系。<br>哎,我也应该弄清楚一些了,我在这方面也是糊涂虫!<br>现在人在外地,等过两天回单位,一定要仔细研究一下各种对应关系。[]
Z zanpen2001 Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-04 #12 兄台所言让在下倍感温暖,原来你也和我一样啊!你说的方法我已经在用了。<br>过两天你回单位了,我却又要出差了,我的QQ:10463082,出差的话不常Q,<br>但很想和你认识。有什么问题可以共同讨论。<br><br>:)<br>
兄台所言让在下倍感温暖,原来你也和我一样啊!你说的方法我已经在用了。<br>过两天你回单位了,我却又要出差了,我的QQ:10463082,出差的话不常Q,<br>但很想和你认识。有什么问题可以共同讨论。<br><br>:)<br>
T tseug Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-05 #13 刚刚整理出来的, 不完整的请大家补充<br><br>INT -> Integer <br>UNSIGNED -> Word <br>UNSIGNED INT -> Word <br>UINT -> Word <br>WORD -> Word <br>UNSIGNED SHORT -> Word <br>UNSIGNED SHORT INT -> Word <br>SHORT -> SmallInt <br>SHORT INT -> SmallInt <br>DWORD -> LongInt <br>LONG -> LongInt <br>LONG INT -> LongInt <br>UNSIGNED LONG -> LongInt <br>UNSIGNED LONG INT -> LongInt <br>CHAR -> Char <br>UNSIGNED CHAR -> Byte <br>CHAR* -> PChar <br>LPSTR -> PChar <br>PSTR -> PChar <br>LPWSTR -> PWideChar <br>PWSTR -> PWideChar <br>VOID* -> Pointer <br>BOOL -> Bool <br>FLOAT -> Single <br>DOUBLE -> Double <br>LONG DOUBLE -> Extended <br>HANDLE -> THandle <br>FARPROC -> TFarProc <br>ATOM -> TAtom <br>TPOINT -> TPoint <br>TRECT -> TRect <br>COLORREF -> TColorRef <br>OFSTRUCT -> TOFStruct <br>DEBUGHOOKINFO -> TDebugHookInfo <br>BITMAP -> TBitMap <br>RGBTRIPLE -> TRGBTriple <br>RGBQUAD -> TRGBQuad <br>BITMAPCOREHEADER -> TBitmapCoreHeader <br>BITMAPINFOHEADER -> TBitmapInfoHeader <br>BITMAPINFO -> TBitmapInfo <br>BITMAPCOREINFO -> TBitmapCoreInfo <br>BITMAPFILEHEADER -> TBitmapFileHeader <br>HANDLETABLE -> THandleTable <br>METARECORD -> TMetaRecord <br>METAHEADER -> TMetaHeader <br>METAFILEPICT -> TMetaFilePict <br>TEXTMETRIC -> TTextMetric <br>NEWTEXTMETRIC -> TNewTextMetric <br>LOGBRUSH -> TLogBrush <br>LOGPEN -> TLogPen <br>PATTERN -> TPattern <br>PALETTEENTRY -> TPaletteEntry <br>LOGPALETTE -> TLogPalette <br>LOGFONT -> TLogFont <br>ENUMLOGFONT -> TEnumLogFont <br>PANOSE -> TPanose <br>KERNINGPAIR -> TKerningPair <br>OUTLINETEXTMETRIC -> TOutlineTextMetric <br>FIXED -> TFixed <br>MAT2 -> TMat2 <br>GLYPHMETRICS -> TGlyphMetrics <br>POINTFX -> TPointFX <br>TTPOLYCURVE -> TTTPolyCurve <br>TTPOLYGONHEADER -> TPolygonHeader <br>ABC -> TABC <br>RASTERIZER_STATUS -> TRasterizer_Status <br>MOUSEHOOKSTRUCT -> TMouseHookStruct <br>CBTACTIVATESTRUCT -> TCBTActivateStruct <br>HARDWAREHOOKSTRUCT -> THardwareHookStruct <br>EVENTMSG -> TEventMsg <br>WNDCLASS -> TWndClass <br>MSG -> TMsg <br>MINMAXINFO -> TMinMaxInfo <br>SEGINFO -> TSegInfo <br>ACCEL -> TAccel <br>PAINTSTRUCT -> TPaintStruct <br>CREATESTRUCT -> TCreateStruct <br>CBT_CREATEWND -> TCBT_CreateWnd <br>MEASUREITEMSTRUCT -> TMeasureItemStruct <br>DRAWITEMSTRUCT -> TDrawItemStruct <br>DELETEITEMSTRUCT -> TDeleteItemStruct <br>COMPAREITEMSTRUCT -> TCompareItemStruct <br>WINDOWPOS -> TWindowPos <br>WINDOWPLACEMENT -> TWindowPlacement <br>NCCALCSIZE_PARAMS -> TNCCalcSize_Params <br>SIZE -> TSize <br>MENUITEMTEMPLATEHEADER -> TMenuItemTemplateHeader<br>MENUITEMTEMPLATE -> TMenuItemTemplate <br>DCB -> TDCB <br>COMSTAT -> TComStat <br>MDICREATESTRUCT -> TMDICreateStruct <br>CLIENTCREATESTRUCT -> TClientCreateStruct <br>MULTIKEYHELP -> TMultiKeyHelp <br>HELPWININFO -> THelpWinInfo <br>CTLSTYLE -> TCtlStyle <br>CTLtype -> TCtltype <br>CTLINFO -> TCtlInfo <br>DDEADVISE -> TDDEAdvise <br>DDEDATA -> TDDEData <br>DDEPOKE -> TDDEPoke <br>DDEAACK -> TDDEAck <br>DEVMODE -> TDevMode <br>
刚刚整理出来的, 不完整的请大家补充<br><br>INT -> Integer <br>UNSIGNED -> Word <br>UNSIGNED INT -> Word <br>UINT -> Word <br>WORD -> Word <br>UNSIGNED SHORT -> Word <br>UNSIGNED SHORT INT -> Word <br>SHORT -> SmallInt <br>SHORT INT -> SmallInt <br>DWORD -> LongInt <br>LONG -> LongInt <br>LONG INT -> LongInt <br>UNSIGNED LONG -> LongInt <br>UNSIGNED LONG INT -> LongInt <br>CHAR -> Char <br>UNSIGNED CHAR -> Byte <br>CHAR* -> PChar <br>LPSTR -> PChar <br>PSTR -> PChar <br>LPWSTR -> PWideChar <br>PWSTR -> PWideChar <br>VOID* -> Pointer <br>BOOL -> Bool <br>FLOAT -> Single <br>DOUBLE -> Double <br>LONG DOUBLE -> Extended <br>HANDLE -> THandle <br>FARPROC -> TFarProc <br>ATOM -> TAtom <br>TPOINT -> TPoint <br>TRECT -> TRect <br>COLORREF -> TColorRef <br>OFSTRUCT -> TOFStruct <br>DEBUGHOOKINFO -> TDebugHookInfo <br>BITMAP -> TBitMap <br>RGBTRIPLE -> TRGBTriple <br>RGBQUAD -> TRGBQuad <br>BITMAPCOREHEADER -> TBitmapCoreHeader <br>BITMAPINFOHEADER -> TBitmapInfoHeader <br>BITMAPINFO -> TBitmapInfo <br>BITMAPCOREINFO -> TBitmapCoreInfo <br>BITMAPFILEHEADER -> TBitmapFileHeader <br>HANDLETABLE -> THandleTable <br>METARECORD -> TMetaRecord <br>METAHEADER -> TMetaHeader <br>METAFILEPICT -> TMetaFilePict <br>TEXTMETRIC -> TTextMetric <br>NEWTEXTMETRIC -> TNewTextMetric <br>LOGBRUSH -> TLogBrush <br>LOGPEN -> TLogPen <br>PATTERN -> TPattern <br>PALETTEENTRY -> TPaletteEntry <br>LOGPALETTE -> TLogPalette <br>LOGFONT -> TLogFont <br>ENUMLOGFONT -> TEnumLogFont <br>PANOSE -> TPanose <br>KERNINGPAIR -> TKerningPair <br>OUTLINETEXTMETRIC -> TOutlineTextMetric <br>FIXED -> TFixed <br>MAT2 -> TMat2 <br>GLYPHMETRICS -> TGlyphMetrics <br>POINTFX -> TPointFX <br>TTPOLYCURVE -> TTTPolyCurve <br>TTPOLYGONHEADER -> TPolygonHeader <br>ABC -> TABC <br>RASTERIZER_STATUS -> TRasterizer_Status <br>MOUSEHOOKSTRUCT -> TMouseHookStruct <br>CBTACTIVATESTRUCT -> TCBTActivateStruct <br>HARDWAREHOOKSTRUCT -> THardwareHookStruct <br>EVENTMSG -> TEventMsg <br>WNDCLASS -> TWndClass <br>MSG -> TMsg <br>MINMAXINFO -> TMinMaxInfo <br>SEGINFO -> TSegInfo <br>ACCEL -> TAccel <br>PAINTSTRUCT -> TPaintStruct <br>CREATESTRUCT -> TCreateStruct <br>CBT_CREATEWND -> TCBT_CreateWnd <br>MEASUREITEMSTRUCT -> TMeasureItemStruct <br>DRAWITEMSTRUCT -> TDrawItemStruct <br>DELETEITEMSTRUCT -> TDeleteItemStruct <br>COMPAREITEMSTRUCT -> TCompareItemStruct <br>WINDOWPOS -> TWindowPos <br>WINDOWPLACEMENT -> TWindowPlacement <br>NCCALCSIZE_PARAMS -> TNCCalcSize_Params <br>SIZE -> TSize <br>MENUITEMTEMPLATEHEADER -> TMenuItemTemplateHeader<br>MENUITEMTEMPLATE -> TMenuItemTemplate <br>DCB -> TDCB <br>COMSTAT -> TComStat <br>MDICREATESTRUCT -> TMDICreateStruct <br>CLIENTCREATESTRUCT -> TClientCreateStruct <br>MULTIKEYHELP -> TMultiKeyHelp <br>HELPWININFO -> THelpWinInfo <br>CTLSTYLE -> TCtlStyle <br>CTLtype -> TCtltype <br>CTLINFO -> TCtlInfo <br>DDEADVISE -> TDDEAdvise <br>DDEDATA -> TDDEData <br>DDEPOKE -> TDDEPoke <br>DDEAACK -> TDDEAck <br>DEVMODE -> TDevMode <br>