读书人

pb11调用API函数GetSystemDirectory返

发布时间: 2012-03-27 13:44:24 作者: rapoo

pb11调用API函数GetSystemDirectory返回乱码,是不是bug?
声明函数
ulong GetSystemDirectoryA(ref string wdir, ulong buf) LIBRARY "kernel32.dll"

程序:
string sTmp
ulong max_len
ulong Length
max_len=128
sTmp = space(200)
Length = GetSystemDirectory(sTmp, max_len)


返回的sTmp是乱码
我试了GetWindowsDirectory也是返回乱码.是不是pb11有bug啊?
我尝试了GetSystemDirectory,也是乱码,几种声明都尝试了,都是返回乱码.


[解决办法]
Function uint GetSystemDirectory(ref string lpBuffer,uint uSize) Library 'kernel32.dll' Alias for 'GetSystemDirectoryA;ansi'

不要轻易下结论!
PB11要加;ansi

[解决办法]
真的会被你雷死.

PB10后PB就用的unicode.
所以用ansi的API函数据得声明成4楼的样子.

别动不动就轻易下结论
[解决办法]

探讨
Function uint GetSystemDirectory(ref string lpBuffer,uint uSize) Library 'kernel32.dll' Alias for 'GetSystemDirectoryA;ansi'

不要轻易下结论!
PB11要加;ansi

读书人网 >PB

热点推荐