关于VB的指针操作,大家给点意见,我不知道错没!
意图:
pDeliverResp 是由VC编写的SMGPDeliver函数中的指针
指向“
sMsgID As String
nIsReport As Integer
nMsgFormat As Integer
sRecvTime As String
sSrcrmID As String
sDestTermID As String
nMsgLen As Integer
sMsgContent As String
”
问:我怎么传pDeliverResp 和怎么得到“”内的值?
Private Declare Function SMGPDeliver Lib "SmGwAPI.dll" (ByVal nTimeout As Integer, ByRef pDeliverResp As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type RecieveSM
sMsgID As String
nIsReport As Integer
nMsgFormat As Integer
sRecvTime As String
sSrcrmID As String
sDestTermID As String
nMsgLen As Integer
sMsgContent As String
End Type
过程程序块
Dim DataBuf(315) As Byte
Dim myMsg As RecieveSM
CopyMemory myMsg, DataBuf(0), LenB(myMsg)
ret = SMGPDeliver(GetTimeOut, VarPtr(DataBuf(0)))
End 过程程序块
pDeliverResp 是由VC编写的SMGPDeliver函数中的指针
指向“
sMsgID As String
nIsReport As Integer
nMsgFormat As Integer
sRecvTime As String
sSrcrmID As String
sDestTermID As String
nMsgLen As Integer
sMsgContent As String
”
问:我怎么传pDeliverResp 和怎么得到“”内的值?
Private Declare Function SMGPDeliver Lib "SmGwAPI.dll" (ByVal nTimeout As Integer, ByRef pDeliverResp As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type RecieveSM
sMsgID As String
nIsReport As Integer
nMsgFormat As Integer
sRecvTime As String
sSrcrmID As String
sDestTermID As String
nMsgLen As Integer
sMsgContent As String
End Type
过程程序块
Dim DataBuf(315) As Byte
Dim myMsg As RecieveSM
CopyMemory myMsg, DataBuf(0), LenB(myMsg)
ret = SMGPDeliver(GetTimeOut, VarPtr(DataBuf(0)))
End 过程程序块
...全文
相关推荐
VB实现不需要安装Excel而操作Excel
您还在为服务器上由于客户不愿意安装Excel,而您又要部署一款程序,需要导出到Excel,或者需要把Excel中的数据导入到数据库中而犯愁吗?本例代码,帮您实现不需要安装Excl,而用VB可以操作Excel的样例,希望,给你启示,带了些帮助。
VB实现指针功能
通过对内存的读写,实现其他语言的指针功能,本实例为详细代码加注释,易学易懂。
VB中的指针技术
VB中的指针技术!!!!!!!!!
VB 指针 内存分配
分配内存 用法和C的malloc同理 别忘记释放内存
VB真是想不到系列之四:VB指针葵花宝典之SafeArray.docx
VB真是想不到系列之四:VB指针葵花宝典之SafeArray


VB基础类
