Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 Discussions

Controlling BackGround worker Component In VB.net, Through DLL file created by FORTRAN

Ahmed_A_2
Beginner
551 Views

Hi

I'm using a BackgroungWorker component in VB.net, through this thread I'm calling a DLL file(created by FORTRAN)  and passing arrays between the interface/main program and the DLL filewhich is working without any problem. But, the mean problem I have with controlling this thread , where if the engine/DLL has been stopped after the end of the calculation I expected the backgroundwroker only should be stop as aresult. But this not the case, as when the engine/DLL stops all the interface will be closed not the thread(BackGroundWorker) only. So My question how can I manage that the if the engine stops the thread only should be affected (stops) not all the interface.

any help will be do appreciated

Many thanks

0 Kudos
2 Replies
Anthony_Richards
New Contributor I
551 Views

When you say 'stopped', do you mean a STOP command is executed? Never do that in a DLL.
I would expect that if the number-cruncher in the DLL completes execution normally, or if an error condition is detected, your number-crunching code should be organised and written to exit and return control to the calling program, returning a flag set to an appropriate value (0=normal termination, -1 error condition,+n program exception n etc.)

0 Kudos
Ahmed_A_2
Beginner
551 Views

 Hi Anthony Richard

many thanks , I will do you recommendation and let you know if there is any problem.

many thanks for your help one more time

Ahmed

0 Kudos
Reply