VB调用C++写的dll库后的问题!

ha1ha1ha 2005-10-18 05:00:10
引用一个dll
Dim telconnobj As New FAXCOMXLib.FaxClientX
Dim telnumobj As New FAXCOMXLib.SendTask
Dim telresultobj As New FAXCOMXLib.ResultTask

dim numOfTasks as long

ReDim starttime() as string
ReDim faxendtime()as string
ReDim sendjg()as string
ReDim sendid()as string

ReDim starttime(numOfTasks)as string
ReDim faxendtime(numOfTasks)as string
ReDim sendjg(numOfTasks)as string
ReDim sendid(numOfTasks)as string

telconnobj.PickResultTask mCid, telresultobj
'telresultobj是一个自定义结构,是dll函数库中的!

'telconnobj.PickResultTask mCid, telresultobj他是调用一个c++的dll函数!

for j=0 to numoftasks-1

MsgBox telresultobj.starttime'这是调完dll之后,返回的 telresultobj 这个结构中的!
MsgBox telresultobj.EndTime'这是调完dll之后,返回的 telresultobj 这个结构中的!

到这,,返回的两个时间是正确的!

starttime(j) = telresultobj.starttime
faxendtime(j) = telresultobj.EndTime

MsgBox starttime(j)
MsgBox faxendtime(j)

到这,,这两个时间就都变成telresultobj.starttime了!
next
原本代码中有很多代码,检查到最后,一一删除,就剩这些了,才发现是此问题,请高手帮下兄弟!
...全文
82 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
CatchWind 2005-10-19
  • 打赏
  • 举报
回复
======
MsgBox telresultobj.starttime'这是调完dll之后,返回的 telresultobj 这个结构中的!
MsgBox telresultobj.EndTime'这是调完dll之后,返回的 telresultobj 这个结构中的!

到这,,返回的两个时间是正确的!

starttime(j) = telresultobj.starttime
faxendtime(j) = telresultobj.EndTime
=======
在上面這部分代碼中, 你調用了兩次 telresultobj.starttime和telresultobj.EndTime,
所以第二次取 telresultobj.EndTime剛好 telresultobj.StartTime相同了
建議你取消這兩行試試
==============
MsgBox telresultobj.starttime'这是调完dll之后,返回的 telresultobj 这个结构中的!
MsgBox telresultobj.EndTime'这是调完dll之后,返回的 telresultobj 这个结构中的!
===========
ha1ha1ha 2005-10-18
  • 打赏
  • 举报
回复
numOfTasks这个值取出来了,,忘粘上了
ha1ha1ha 2005-10-18
  • 打赏
  • 举报
回复
Dim starttime() as string
Dim faxendtime()as string
Dim sendjg()as string
Dim sendid()as string

发布的时候粘错了!

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧