怎么来调用一个dll文件中的函数?比如说在api32.dll中的netmessagebuffersend(30分)

  • 主题发起人 主题发起人 whaoye
  • 开始时间 开始时间
W

whaoye

Unregistered / Unconfirmed
GUEST, unregistred user!
比如说在看msdn里的原始申明是:<br>NET_API_STATUS NetMessageBufferSend(<br>&nbsp; LPCWSTR servername, &nbsp;<br>&nbsp; LPCWSTR msgname, &nbsp; &nbsp; <br>&nbsp; LPCWSTR fromname, &nbsp; &nbsp;<br>&nbsp; LPBYTE buf, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; DWORD buflen &nbsp; &nbsp; &nbsp; &nbsp; <br>);<br>但是这是c语言的说明对吧,用到delphi里该怎么来修改呢?<br>最好是告诉一些通用的办法!以及详细的怎么使用dll,我不是很熟悉!谢谢<br>
 
去JEDI下载,人家都声明好了。
 
请问jedi是什么?一个网站吗?具体的地址呢?
 
是不是这个站点?http://www.delphi-jedi.org<br>最好是可以告诉我具体的文件的地址!我英文不是很好,看不懂!!
 
全部的在下面的URL中:<br>ftp://delphi-jedi.org/api/LanManager.zip<br><br>你要的函数:<br>{******************************************************************}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Borland Delphi Runtime Library &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ LanManager share functions for Windows NT interface unit &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Portions created by Microsoft are &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Copyright (C) 1995-1999 Microsoft Corporation. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ All Rights Reserved. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ The original file is: lmmsg.h, released 14 Nov 1998. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ The original Pascal code is: LmMsg.pas, released 11 Jan 2000. &nbsp; &nbsp;}<br>{ The initial developer of the Pascal code is Petr Vones &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ (petr.v@mujmail.cz). &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Portions created by Petr Vones are &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ Copyright (C) 2000 Petr Vones &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Obtained through: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Joint Endeavour of Delphi Innovators (Project JEDI) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ You may retrieve the latest version of this file at the Project &nbsp;}<br>{ JEDI home page, located at http://delphi-jedi.org &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ The contents of this file are used with permission, subject to &nbsp; }<br>{ the Mozilla Public License Version 1.1 (the "License"); you may &nbsp;}<br>{ not use this file except in compliance with the License. You may }<br>{ obtain a copy of the License at &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ http://www.mozilla.org/MPL/MPL-1.1.html &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ Software distributed under the License is distributed on an &nbsp; &nbsp; &nbsp;}<br>{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or &nbsp; }<br>{ implied. See the License for the specific language governing &nbsp; &nbsp; }<br>{ rights and limitations under the License. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{******************************************************************}<br><br>unit LmMsg;<br><br>{$I LANMAN.INC}<br><br>{$ALIGN ON}<br>{$MINENUMSIZE 4}<br>{$WEAKPACKAGEUNIT}<br><br>interface<br><br>uses<br>&nbsp; Windows, LmCons;<br><br>(*$HPPEMIT '#include &lt;netcons.h&gt;'*)<br>(*$HPPEMIT '#include &lt;lmmsg.h&gt;'*)<br><br><br>{$EXTERNALSYM NetMessageNameAdd}<br>function NetMessageNameAdd(servername, msgname: LPCWSTR): NET_API_STATUS; stdcall;<br><br>{$EXTERNALSYM NetMessageNameEnum}<br>function NetMessageNameEnum(servername: LPCWSTR; level: DWORD; bufptr: Pointer;<br>&nbsp; prefmaxlen: DWORD; var entriesread: DWORD; var totalentries: DWORD;<br>&nbsp; resume_handle: PDWORD): NET_API_STATUS; stdcall;<br><br>{$EXTERNALSYM NetMessageNameGetInfo}<br>function NetMessageNameGetInfo(servername: LPCWSTR; msgname: LPCWSTR;<br>&nbsp; level: DWORD; var bufptr: Pointer): NET_API_STATUS; stdcall;<br><br>{$EXTERNALSYM NetMessageNameDel}<br>function NetMessageNameDel(servername, msgname: LPCWSTR): NET_API_STATUS; stdcall;<br><br>{$EXTERNALSYM NetMessageBufferSend}<br>function NetMessageBufferSend(servername: LPCWSTR; msgname: LPCWSTR;<br>&nbsp; fromname: LPCWSTR; buf: Pointer; buflen: DWORD): NET_API_STATUS; stdcall;<br><br>type<br>&nbsp; PMsgInfo0 = ^TMsgInfo0;<br>&nbsp; {$EXTERNALSYM _MSG_INFO_0}<br>&nbsp; _MSG_INFO_0 = record<br>&nbsp; &nbsp; msgi0_name: LPWSTR;<br>&nbsp; end;<br>&nbsp; TMsgInfo0 = _MSG_INFO_0;<br>&nbsp; {$EXTERNALSYM MSG_INFO_0}<br>&nbsp; MSG_INFO_0 = _MSG_INFO_0;<br><br>&nbsp; PMsgInfo1 = ^TMsgInfo1;<br>&nbsp; {$EXTERNALSYM _MSG_INFO_1}<br>&nbsp; _MSG_INFO_1 = record<br>&nbsp; &nbsp; msgi1_name: LPWSTR;<br>&nbsp; &nbsp; msgi1_forward_flag: DWORD;<br>&nbsp; &nbsp; msgi1_forward: LPWSTR;<br>&nbsp; end;<br>&nbsp; TMsgInfo1 = _MSG_INFO_1;<br>&nbsp; {$EXTERNALSYM MSG_INFO_1}<br>&nbsp; MSG_INFO_1 = _MSG_INFO_1;<br><br><br>// Values for msgi1_forward_flag.<br><br>const<br>&nbsp; {$EXTERNALSYM MSGNAME_NOT_FORWARDED}<br>&nbsp; MSGNAME_NOT_FORWARDED &nbsp; = $00; &nbsp; &nbsp;// Name not forwarded<br>&nbsp; {$EXTERNALSYM MSGNAME_FORWARDED_TO}<br>&nbsp; MSGNAME_FORWARDED_TO &nbsp; &nbsp;= $04; &nbsp; &nbsp;// Name forward to remote station<br>&nbsp; {$EXTERNALSYM MSGNAME_FORWARDED_FROM}<br>&nbsp; MSGNAME_FORWARDED_FROM &nbsp;= $10; &nbsp; &nbsp;// Name forwarded from remote station<br><br>implementation<br><br>function NetMessageNameAdd; external netapi32lib name 'NetMessageNameAdd';<br>function NetMessageNameEnum; external netapi32lib name 'NetMessageNameEnum';<br>function NetMessageNameGetInfo; external netapi32lib name 'NetMessageNameGetInfo';<br>function NetMessageNameDel; external netapi32lib name 'NetMessageNameDel';<br>function NetMessageBufferSend; external netapi32lib name 'NetMessageBufferSend';<br><br>end.<br>
 
谢谢你的答案!!!
 
后退
顶部