Solved

Multi-Threading

Posted on 2001-06-13
10
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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