在 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)