Solved

Multi-Threading

Posted on 2001-06-13
10
233 Views
Last Modified: 2008-02-01
How come this always crashes VBA6.DLL when running? Or MSVBVM60.DLL when compiled.

http://www.starcraftsilo.com/threading.zip
0
Comment
Question by:AdiF
10 Comments
 
LVL 2

Expert Comment

by:Microsoft
ID: 6188855
what is it your trying to do . unfort i cannot see that link because our proxy bans me from viewing it.

im at work at mom if you tell me i could probley get you an answer

ONLY MAYBE AS IM PRITTY THICK
0
 
LVL 2

Author Comment

by:AdiF
ID: 6188878
Well I'm using

'clsThreading:
'Simple class that allows you to implement multithreading in your app
'
'(C) 2001 by Philipp Weidmann


i have the following in a module:

Public Function moving()
Do Until Form1.Command1.Top > Form1.Height
Form1.Command1.Top = Form1.Command1.Top + 1
Loop
End Function


and this in the form:

Private Sub Command2_Click()
Set ThreadControl1 = New Class1
ThreadControl1.CreateNewThread AddressOf moving, tpNormal, True
MsgBox "boo"
End Sub



so it makes the button move down
but it crashes
if i remove the until it works and lags for a few seconds until the thread somehow "dies out" for some reason
0
 
LVL 2

Expert Comment

by:Microsoft
ID: 6188900
change the following line from

Do Until Form1.Command1.Top > Form1.Height


TO :-

Do Until Form1.Command1.Top = Form1.Height
0
 
LVL 2

Author Comment

by:AdiF
ID: 6188904
Well I'm using

'clsThreading:
'Simple class that allows you to implement multithreading in your app
'
'(C) 2001 by Philipp Weidmann


i have the following in a module:

Public Function moving()
Do Until Form1.Command1.Top > Form1.Height
Form1.Command1.Top = Form1.Command1.Top + 1
Loop
End Function


and this in the form:

Private Sub Command2_Click()
Set ThreadControl1 = New Class1
ThreadControl1.CreateNewThread AddressOf moving, tpNormal, True
MsgBox "boo"
End Sub



so it makes the button move down
but it crashes
if i remove the until it works and lags for a few seconds until the thread somehow "dies out" for some reason
0
 
LVL 2

Author Comment

by:AdiF
ID: 6188913
that did not help at all hehe ;)
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 28

Expert Comment

by:AzraSound
ID: 6188927
VB6 is much less thread-safe than VB5 was...if you wish to implement multithreading, look at using ActiveX EXEs:

"Multi-Threaded VB Using ActiveX EXEs"
http://vbaccelerator.com/codelib/thread/exethr.htm
0
 
LVL 3

Accepted Solution

by:
adg earned 150 total points
ID: 6189232
Have a look at the responses to this question.  

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20133973
0
 
LVL 8

Expert Comment

by:AJAY CHADHA
ID: 6189548
Look here "How to implement Multuthreading in VB". This is the best one i've ever seen.

http://www.winsolutions.de/files/Multithreading.zip

Good Luck...

Ajay Chadha .. :-)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136083
Hi AdiF,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: AzraSound and adg@hp

AdiF, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7181573
Per recommendation, force-accepted.

Netminder
CS Moderator

AzraSound: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328623
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now