求教如何调用一个DLL中的函数?

dyfh 2003-06-17 04:20:17
要在BCB5中调用netapi32.dll下的NetMessageBufferSend函数,可是初学,不知道如何引用该函数,参数如何配套,请教各位达人怎么写?

我已经用implib导出他的lib文件了
...全文
84 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
dyfh 2003-06-17
  • 打赏
  • 举报
回复
解决!
#include <lm.h>
#include <lmmsg.h>
#pragma comment(lib,"netapi32.lib")
dyfh 2003-06-17
  • 打赏
  • 举报
回复
to : kingcaiyao(AKing) :
看了,但那些乱七八糟的定义看不明白


LPTSTR
LPTSTR
LPTSTR
LPBYTE

都是指什么呀?
dyfh 2003-06-17
  • 打赏
  • 举报
回复
to coking
加入了那一行,但出错:
怎么回事?
[C++ Error] lmmsg.h(41): E2141 Declaration syntax error
[C++ Error] lmmsg.h(47): E2238 Multiple declaration for 'NET_API_STATUS'
[C++ Error] lmmsg.h(41): E2344 Earlier declaration of 'NET_API_STATUS'
[C++ Error] lmmsg.h(47): E2141 Declaration syntax error
[C++ Error] lmmsg.h(58): E2238 Multiple declaration for 'NET_API_STATUS'
[C++ Error] lmmsg.h(47): E2344 Earlier declaration of 'NET_API_STATUS'
[C++ Error] lmmsg.h(58): E2141 Declaration syntax error
[C++ Error] lmmsg.h(66): E2238 Multiple declaration for 'NET_API_STATUS'
[C++ Error] lmmsg.h(58): E2344 Earlier declaration of 'NET_API_STATUS'
[C++ Error] lmmsg.h(66): E2141 Declaration syntax error
[C++ Error] lmmsg.h(72): E2238 Multiple declaration for 'NET_API_STATUS'
[C++ Error] lmmsg.h(66): E2344 Earlier declaration of 'NET_API_STATUS'
[C++ Error] lmmsg.h(72): E2141 Declaration syntax error
COKING 2003-06-17
  • 打赏
  • 举报
回复
#include <lmmsg.h>
kingcaiyao 2003-06-17
  • 打赏
  • 举报
回复
为什么不看一下msdn或bcb自带的sdk呢?

the NetMessageBufferSend function sends a buffer of information to a registered message alias.

Security Requirements

No special group membership is required to execute NetMessageBufferSend on a LAN Manager or Windows NT system. Admin, Accounts, Print, or Server operator group membership is required to successfully execute NetMessageBufferSend on a remote server.

NET_API_STATUS NetMessageBufferSend(

LPTSTR servername,
LPTSTR msgname,
LPTSTR fromname,
LPBYTE buf,
DWORD buflen
);


Parameters

servername

Pointer to a Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.

msgname

Pointer to a Unicode string containing the message name to which the message buffer should be sent.

fromname

Pointer to a Unicode string containing the message name sending the information. The fromname parameter is new for Windows networking. This parameter is needed for sending interrupting messages from the computer name rather than the logged on user. If NULL is specified, the message is sent from the logged-on user as with LAN Manager 2.x.

buf

Pointer to a buffer of message text.

buflen

The length, in bytes, of the message text in buf.
he_Fly 2003-06-17
  • 打赏
  • 举报
回复
如果你不知道参数是什么样的,那你有两种办法, 一种是试,第二种是静态反汇编。

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧