ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

How to close a Fortran DLL routine when exiting Visual Basic (front-end) program

<< < (2/5) > >>

OptimalDesigns:
Over my head!!!  Guess I'll just leave it for someone else to work on.

Thanks for your efforts KodeZwerg and wraith808,
Phil

KodeZwerg:
Last i can do:
If your dll is available somewhere and you have full headers to it, i could check-out with Delphi if error is in dll or your Application.

OptimalDesigns:
Yes it is downloadable from http://fortrancalculus.info/misc/download.html page.  It is the SpectrumSolvers app ... includes all source files.  The DLL is named PSDcalc_for.dll and once downloaded and installed, the DLL is found in the \od-tools\SpectrumSolvers directory.

Thanks your your efforts.
Phil
PS:  The app closes fine -unless- the DLL is executed.  If the DLL is executed, it hangs the app when trying to close the VB app.

KodeZwerg:
PS:  The app closes fine -unless- the DLL is executed.  If the DLL is executed, it hangs the app when trying to close the VB app.
--- End quote ---
I apply download this evening, tomorrow i should be able to give you a statement.
I will debug and see what this dll does during execution. I will try rebuild your Post #1 to Delphi and see what happens.

KodeZwerg:
edited
I was bored @work, quick get your download, by reading the source (i just guess whats what in that language) things that i found remarkable:
good news, i figured out that dll is just one function. *hoorray*

in that function are many "write()" commands, i guess that you develop a console application then, right? for me it would be bad to call write() events from dll.
-Okay, now i know that it writes a file, sorry for that.

what i think is way critical, if it is a console dll, there are "call timer()" events, my very first idea = bad. (i should need information what that language means with "call timer()")
-Okay, no console App, sorry for that, i investigate that deeper.
-My stomach tells me that dll could hang in one of those many repeats and loops and for and goto things when you try to close calling application.
-If you are able to Thread it, i would thread that operation. A dll is not the best way to accomplish what you are doing.
-My suggestion would be: rewrite that dll method so you get as result whatever content you wish to write to file inside your VB App and apply the file-writing -stuff there. Most important would be something like a "i am ready" message/boolean/whatever that your VB need to wait for.

next i see alot of "Allocate()" commands but somehow no "De-Allocate()" or however its name should be.
-Sorry, now found some DeAllocate().

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version