?
Solved

Multi-Threading

Posted on 2001-06-13
10
Medium Priority
?
254 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
Industry Leaders: 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 600 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

Industry Leaders: 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!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

771 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