Windows 7上的VB6(第二功能) [英] VB6 (Second Function) on Windows 7

查看:73
本文介绍了Windows 7上的VB6(第二功能)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.我正在Windows 7上一个非常老的程序(和vb6)中添加新内容.
该程序使用DateTime成员Second来获取当前时间的秒数.

我的问题是我必须注释掉Second(分钟,小时工作正常)以便生成可执行文件或编译源代码.如果我不这样做,则会弹出索引错误.为什么Minute and Hour可以很好地工作,但第二种却不能,这超出了我...

如果有人知道如何编译/制作exe文件而不会弹出错误(在Windows 7计算机上),请告诉我.

提前谢谢!

以下部分已从评论中移出-LOSMAC [/EDIT]

好的,我不知道解决问题的方法,但是我找到了另一种方法来做同样的事情,而不会在Win7上出错.可能,所以我仍在寻找解决方案.

Hi, everyone. I''m adding new stuff to a really really old (and vb6) program on Windows 7.
The program uses the DateTime member Second to get the current time''s seconds.

My problem is that I have to comment out Second (Minute, Hour work fine) in order to make an executable, or compile the source. If I don''t an index error pops up. Why Minute and Hour work fine, but not Second, is beyond me...

If anyone knows how I can compile/make exe file without the error poppling up (and on a Windows 7 machine), please let me know.

Thanks in advance!

The section below was moved from comment - LOSMAC[/EDIT]

Ok, I don''t know the solution to my problem, but I found another way to do the same thing that doesn''t make an errors on Win7.. I would really like to change the code back to its original state if possible, so I''m still looking for solutions.

Dim sec As Byte
Dim min As Byte
Dim strSec As String
'** Minute works OK
min = Minute(Time)
'** Second is No good (So I deleted it)
'** sec = Second(Time)
'** The following code doesn't make any errors, so I'm using it...
strSec = Format(Time, "s") sec = Val(strSec)

推荐答案

请阅读有关
Please, read more about DateTime.Second[^] Property.


这篇关于Windows 7上的VB6(第二功能)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆