首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

pb9 调用 api 有关问题

2012-03-18 
pb9 调用 api 问题在 Local External Functions 里面定义了如下Function ulong GetComputerName(ref Strin

pb9 调用 api 问题
在 Local External Functions 里面定义了如下
Function ulong GetComputerName(ref String ls_Buffer, int nSize) Library "kernel32"

但在一个button 里面调用确出错:
string ls_computer_name
ls_computer_name = space(100)

GetComputerName(ls_computer_name,100)
MessageBox("",ls_computer_name) 

显示:Error calling external function getcomputername at line 23 in clicked event of object cb_3 of w_main
怎么调用啊?

[解决办法]

C/C++ code
string ls_computer_namelong ll_size = 100ls_computer_name = space(ll_size)GetComputerName(ls_computer_name,ll_size)MessageBox("",ls_computer_name) 

热点排行