龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VB开发 >

将包含有Null结尾的字符串转换为VB字符串

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
在VB编程调用WindowsAPI函数时,经常会碰到以Null结尾的字符串,下面是一段将Null结尾字符串转换到VB字符串的函数:
  PublicFunctionLPSTRToVBString$(ByVals$)
  Dimnullpos&
  nullpos&=InStr(s$,Chr$(0))
  Ifnullpos>0Then
  LPSTRToVBString=Left$(s$,nullpos-1)
  Else
  LPSTRToVBString=""
  EndIf
  EndFunction->

精彩图集

赞助商链接