pb中调用c++编写的动态库

pgpga 2003-10-10 11:29:17
我用vc.net写了个动态库文件,想在pb中调用声明为
SendMessageSelf(
WCHAR * wszComputerName,
WCHAR * wszQueueName,
WCHAR * wszQueueTitle,
LPCTSTR wszQueueContent
)
的函数,在pb中声明传递参数时用何种数据类型?
...全文
102 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
老吴子 2003-10-11
  • 打赏
  • 举报
回复
由于PowerBuilder目前不支持Unicode(PB6.5 Unicode版除外),所以你输出的函数要求使用Unicode不太合适,建议如下:
SendMessageSelf(
char* wszComputerName,
char* wszQueueName,
char* wszQueueTitle,
char* wszQueueContent
)
在C++中可以简单的将char*转换成WCHAR*;另外为了避免C++编译器所带来的不确定性,建议在C++中声明如下:
extern "C"{
__declspec(dllexport) void __stdcall SendMessageSelf(
char* wszComputerName,
char* wszQueueName,
char* wszQueueTitle,
char* wszQueueContent
)
}
假设wszQueueContent返回
在Powerbuilder中声明如下:
subroutine SendMessageSelf(string wszComputerName,string wszQueueName,&
string wszQueueTitle,ref string wszQueueContent)&
library 'mydll.dll' alise for '_SendMessageSelf@16'
具体的函数名可能不同,如果你用了.Def文件来生成DLL,则可能就是SendMessageSelf。
xavier_lee 2003-10-10
  • 打赏
  • 举报
回复
char sz
structure st
编程夜猫 2003-10-10
  • 打赏
  • 举报
回复
string ls_str

ls_str = space(255)
workhand 2003-10-10
  • 打赏
  • 举报
回复
string
structure

680

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder API 调用
社区管理员
  • API 调用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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