Private Declare Function GetPeopleName Lib "termb.dll" (ByVal lpBuffer As String, ByVal strLen As Integer) As Integer
Dim str As String
Dim iRet As Integer
str = Space$(256)
iRet = GetPeopleName(str, 256)
Text1(0).Text = Trim(str)
我这样写不出错,但是str不返回数据,麻烦帮忙看看哪里错了。
[DllImport("termb.dll")]
static extern int GetPeopleName(string lpBuffer, uint strLen);
string str;
int iRet;
iRet = GetPeopleName(str, 256);
textBox1.Text=str;
10 个解决方案
#1
[DllImport("termb.dll")]
static extern int GetPeopleName(StringBuilderlpBuffer, uint strLen);
StringBuilder sb = new StringBuilder(256);
int iRet;
iRet = GetPeopleName(sb, 256);
textBox1.Text=sb.ToString();
static extern int GetPeopleName(StringBuilderlpBuffer, uint strLen);
StringBuilder sb = new StringBuilder(256);
int iRet;
iRet = GetPeopleName(sb, 256);
textBox1.Text=sb.ToString();
#2
楼下的不要和我抢了。。。^_^
#3
string str;
int iRet;
str = Strings.Space(256);
iRet = GetPeopleName(str, 256);
Text1(0).Text = Strings.Trim(str);
int iRet;
str = Strings.Space(256);
iRet = GetPeopleName(str, 256);
Text1(0).Text = Strings.Trim(str);
#4
我觉得不能用StringBuilder
#5
加上 ref ??
#6
Avoid(千金散尽还复来)
你的是完全正确的。谢谢。请接分!
你的是完全正确的。谢谢。请接分!
#7
......
#8
帮顶
#9
。。。不抢帮顶
#10
路过!!
#1
[DllImport("termb.dll")]
static extern int GetPeopleName(StringBuilderlpBuffer, uint strLen);
StringBuilder sb = new StringBuilder(256);
int iRet;
iRet = GetPeopleName(sb, 256);
textBox1.Text=sb.ToString();
static extern int GetPeopleName(StringBuilderlpBuffer, uint strLen);
StringBuilder sb = new StringBuilder(256);
int iRet;
iRet = GetPeopleName(sb, 256);
textBox1.Text=sb.ToString();
#2
楼下的不要和我抢了。。。^_^
#3
string str;
int iRet;
str = Strings.Space(256);
iRet = GetPeopleName(str, 256);
Text1(0).Text = Strings.Trim(str);
int iRet;
str = Strings.Space(256);
iRet = GetPeopleName(str, 256);
Text1(0).Text = Strings.Trim(str);
#4
我觉得不能用StringBuilder
#5
加上 ref ??
#6
Avoid(千金散尽还复来)
你的是完全正确的。谢谢。请接分!
你的是完全正确的。谢谢。请接分!
#7
......
#8
帮顶
#9
。。。不抢帮顶
#10
路过!!