Apologies for the mess, but what I have been trying to do is experiment with integer(handle) replacing integer. The code used for interfacing was developed by a young colleague 20+ years ago and my program actually ran very well until recently when I guess 32 bits were replaced with 64 bits. I have made quite a bit of progress, but am kind of stuck on this ghwndmain parameter. I am aware there are a number of integer definitions within dia_intr.inc, which perhaps should be integer(handle), but that shouldn’t affect ghwndmain, should it not?. It seems whether I define ghwndmain as integer(handle) in win_intr.f90 or not, I still have a problem with it. For the record when I carry out a compilation, I first clean, then compile win_intr, then tools and finally osda. Any ideas what might me causing the problem?
Yes, that “integer fstring” is certainly suspicious. TBH, I had never run across this routine before - like the rest of IFWBASE its origins are Microsoft Fortran PowerStation. The name of the function is confusing, as it is being used to copy a C string from an OPENFILENAMEA structure to a local character variable (a Fortran string). None of the provided Windows API samples use it.
In any case, I agree with you that the interface is bad. It would not be difficult to come up with a function written in Fortran to replace it. If I were doing this, I’d add a “rename” to USE IFWBASE to hide the bad interface, for example:
use ifwbase, donotuse => ConvertFtoCstring
then I would declare my own function by that name.
I had thought that by restricting the size of the program, it would easier to find out and correct the problems, but now I see that was probably a mistake. I am now working on the complete program, which I have zipped and placed in drop box. I have also included the compilation and as you can see it objects at line 86 of osd_c.f90 – not sure why. The zipped program is exactly that which runs successfully on the later Intel Visual Fortran, apart from the modifications in dia_intr.inc which you suggested in your latest correspondence and a number of modifications within win_intr.f90, although not sure whether what I’ve done is correct.
Once again apologies for making things actually more confusing by not including the entire code to start with.
opticsoft_14-03-2026.7z (675 KB)
@intel_ip Is that collection of Optisoft files complete? Can you tell me which file contains the main program? I couldn’t find it…
For the record opticsoft.f90 is the main function.
Shouldn’t have stated latest IVF, rather the IVF version a couple of years ago.
