- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I'm dveloping VB.net program , where I'm using backgroundWorker component to have anther thread. To start the thread I used
BackgroundWorkerRun.RunWorkerAsync() ,and to pend this thread I used
BackgroundWorkerRun.WorkerSupportsCancellation = True
BackgroundWorkerRun.CancelAsync()
But The main problem that I have is how to Stop this thread , Could you please help me to solve this problem and It will be appreciated if you provid me with some example for how to stop BackgroungWorker
Many thanks
Ahmed
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will be do appreciate if you explain more to to use method Dispose
many thanks
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh , you are right. I have already did that
many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have solved the problem of controlling the thread as I mentioned before.But I'm facing anther problem with Fortran DLL file I'm using.While I can run , pause , and stop the thread that call the Fortran Dll file ,but I can not run anther model where the calling to the subroutine from VB.net exist in the DLL file done onece and when the simulation done and the function return to the main call I will not be able to call this subroutine again untill I close the whole interface. Could you please help me what are the sources of such problem , as I don't have to close the interface inorder to run anther program(It seems to me the dll file is busy by something although the simulation is done)
this is the fortran subroutine I'm using
Subroutine FortranDLL(A,IA)
!MS$ATTRIBUTES DLLEXPORT, ALIAS: 'FORTRANDLL' :: FortranDLL
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION A(5000001),IA(5000001)
OPEN(unit=1000,file=
+'C:\Sams2000\Applications\ATTIF2000\Engine\AttifSavedResults.txt')
CALL ATIFLO00(A,IA)
CLOSE (1000)
Return
End Subroutine FortranDLL
and this is the decleration and the call in VB.net
Declare Sub FortranDLL Lib "C:\Sams2000\Applications\ATTIF2000\Engine\ATTIFDLLENG.dll" Alias "FORTRANDLL" (<[In](), Out()> ByVal A() As Double, ByVal IA() As Int32)
Private Sub BackgroundWorkerRun_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorkerRun.DoWork
FortranDLL(A, IA)
MsgBox("Simulation Done.")
End Sub
Your help is all the time important
Many thanks
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have already done that before and , I did it again as you asked right now. After it is done with the first call of FortranDLL( A, IA ), amessage MsgBox("Simulation Done - 1") appears, and then the interface closed/crashed at the second call of FortranDLL( A, IA ), without any error messages but it is clear it is because the second call
Your help will be appreciated.
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page