This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 向VB高手求救: 请见内文?
-redmouthbird(Everything but girl);
2002-10-4
{579}
(#781364@0)
-
我也有过这种情况,后来有人知道,既然在1后面肯定要执行2,那为什么不把2放到1中去调用呢,不要放在主的地方调用,这样既能保证2肯定得到1的参数,又能提高程序效率
-oceandeep(北极熊® Zzz Zzz);
2002-10-4
(#781377@0)
-
那样做不还是一样吗? 那为什么, 用Msgbox 以后就没问题了?! 而用Sleep 就不行了? 请教.
-redmouthbird(Everything but girl);
2002-10-4
(#781406@0)
-
有可能是程序的并行处理,不知道1能不能在sleep15000前做完
-oceandeep(北极熊® Zzz Zzz);
2002-10-4
(#781416@0)
-
那你知道如何通过代码来模拟 "回车" 吗?
-redmouthbird(Everything but girl);
2002-10-4
(#781413@0)
-
SendKeys "{ENTER}"
-pingyangtiger(平阳虎);
2002-10-4
(#781418@0)
-
我也是初学者,只懂一点
-oceandeep(北极熊® Zzz Zzz);
2002-10-4
(#781419@0)
-
"sleep" stops the current execution, including the "command1". try "timer" if the delay is neccessary.
-pingyangtiger(平阳虎);
2002-10-4
(#781439@0)
-
I got it . just coz sleep will stop all execuation , which is no good . using timer makes it better . Thanks buddy .
-redmouthbird(Everything but girl);
2002-10-4
(#781492@0)
-
示例代码见内private cmdAction1NotFinished as boolean
Private Sub cmdDoAll_Click()
cmdAction1NotFinished =false
Call cmdAction1_Click
while cmdAction1NotFinished
DoEvents
wend
Call cmdAction2_Click
End Sub
private sub IE_DocumentFinished( url....)
cmdAction1NotFinished =true
end sub
-miketany(MIKE老狼);
2002-10-4
{293}
(#781452@0)
-
呵呵,这个代码我做过,这样,在1 做完前 cpu的占用率 一直是 100%,被我的 director 看见了,惨哪
-oceandeep(北极熊® Zzz Zzz);
2002-10-4
(#781458@0)
-
you not kidding, are u?timer is a better solution, I would say, as someone above said,
the only different is you have to figure out a better way to detect
the finish-event of 1st command, i always worry about dead-loop
kind of things
-rootbear(啤酒(^v^));
2002-10-4
{214}
(#781505@0)
-
其实我是想说:不能用sleep。因为主线程sleep会无法接收到第一个call完成时的消息。其实更合理的作法是在第一个call完成的消息里执行第二个call
-miketany(MIKE老狼);
2002-10-4
(#781563@0)
-
use vb's timer, it works in thread mode.
-bluebluesky(bluebluesky);
2002-10-4
(#781941@0)
-
请教一个问题:VB中如何把一个异步方法转为同步方法?其实这和正在讨论的问题是一样的,不能sleep,不能timer,如果用循环又会占用CPU,高手有什么办法吗?
-miketany(MIKE老狼);
2002-10-4
(#781973@0)
-
VB好象没办法实现VC的那种多线成, 以前试验而已, 即使去得线程序号也控制不了。 不过大概手低, 不灵
-ningxin0809(雁影行洲);
2002-10-4
(#781983@0)
-
你不是自己解决了嘛,互相调用
-oceandeep(北极熊® Zzz Zzz);
2002-10-4
(#781986@0)
-
不明白,能详细一点吗?我正要做一个function,把一个异步调用的方法包装成一个同步方法,是不容易
-miketany(MIKE老狼);
2002-10-4
(#782489@0)
-
偶以前做过,最近没空,天天在TTC上横贯toronto,劳命伤财,过两天再来看你们做好了没。
-henhen(哼哼~~,找工ing~~~~);
2002-10-8
(#787731@0)
-
1, I think you can you Semaphore, mutex this kind of API, for example, Semaphore, WaitForSingleObject works in the way u want)2, develop a dll using VC, and send a handle( for example , edit) to dll, and in the dll develop a function, using SendMessage, PostMessage, post the message to the handle's holder, in the holder's event(for example edit's onchange) deal with defferent message useful to you.
-bluebluesky(bluebluesky);
2002-10-8
{278}
(#787445@0)
-
use event, not doEvent
-interview(intervieweree);
2002-10-4
(#782058@0)