PDA

View Full Version : fortran DLL for VB and LF95


Maurizio
03-02-2004, 11:48 AM
Hi there, I have to admit that I am pretty new to Fortran coding in general and I hope you can give me some good advice to sort this troubles out: my research group owns both lf90 and lf95 (version 5.00c) We used to compile our code onto a DLL for VB code onto a Win98 machine using
lf90 filename.f90 -tp -win -dll -ml msvb

lf90 doesn't seem to like working on windows 2000 machine so I decided to try and compile the DLL with lf95, by using
lf95 filename.f90 -tp -win -dll -ml msvb

the resulting dll file is smaller than the one created by lf90 (626kb against 688kb)
and basically it doesn't work...when the VB code calls it it just spits out an error and makes the VB code crash.
Any idea (that doesn't involve buying a new version of the lf95 compiler possibly :p ) is very much appreciated
Cheers
Maurizio

tzeis
03-03-2004, 12:40 AM
Some things to try:

1) Download the last maintenance patch for 5.0 (patch "f') and install it.

2) Try compiling with -chk and/or -trap to see if the code is doing something nasty.

3) Try downloading the trial version of the compiler to see if the latest version fixes the problem.

4) Describe the error that VB is issuing and the circumstances of the crash.

Maurizio
03-03-2004, 11:38 AM
1) downloaded and applied, but it didnt make any difference to the final result

2)nothing different happens with -chk or -trap

3) I dowloaded lf95 5.7 Express and installed it. it creates a dll that actually works with our VB code, but we don't have the DOS window that was in the background in the past and that we normally used for debugging purposes...is there any way of getting that one back? (it didn't like the -win option when compiling)


4) the error upoin crashing is with lf95 5.00f
Application Error:
The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read"

Thanks for your help
Any other idea?
Maurizio

tzeis
03-03-2004, 07:26 PM
3) Try compiling with the -winconsole option, that should cause a console to appear. You could alternatively send your debugging info to a disk file.

4) An effective debugging technique is to eliminate code in small chunks until the error goes away. When the error stops happening, the problem is probably in the chunk of code that was last eliminated. To quickly see if this technique will be effective, first try removing all the code so that the dll procedure does nothing but return. If there is no error, the technique should let you isolate the problem code. This technique depends on your ability to remove code in a way that does not introduce compilation or execution errors.