Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multi-Threading

Posted on 2001-06-13
10
Medium Priority
?
256 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
Technology Partners: 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…
Suggested Courses

618 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