Solved

Multi-Threading

Posted on 2001-06-13
10
238 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 / DAO 3.6 / run time error: Couldn't find installable ISAM 7 79
VBA error replacing data 6 37
How to debug this code 7 56
vb6 connector to SQL Server 2 34
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

863 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

23 Experts available now in Live!

Get 1:1 Help Now