- 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
Wow - that's old. My guess then would be that you encountered a compiler bug related to uninitialized variable checking. In that case I suggest just disabling that option in the project properties (under Fortran > Run-Time) and forget about it.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problems? Great! :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
I du not understand what happened, why my text disappeared. Anyway I describe it once again: I have used the Winprint_Direct successfully in the days of QVF. I also apply the IVF version successfully with a IVF Win32 application. I am now migrating a QWin CVF application to Qwin IVF. When I compile the WinPrint_Direct file I get the message:
C:\CALC\CaFeMS\LIB-filer\WinPrint_Direct_A.f90(240): warning #7799: %LOC is being stripped from argument which has REFERENCE and IGNORE_LOC attributes. [HPRINTER]
However, the program can be linked and run. But when I print a file, the program crashes with the following message: forrtl: severe(193): Run-Rime Check Failure. The variable '_WINPRINT_DIRECT_mp_PPRINT_DIRECT$PRINT_DIRECT' is being used without being defined.
The program breaks at the last line:
end function Print_Direct
What can it be? A missing definition of a variable, how to fix, I tried to apply just "end function", but without success..
I just mention that the sample program WinPrint_Direct works as intended..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:
No problems? Great! :-)
Steve, he probably posted his problem report using WinPrintDirect!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The warning can be ignored, but you can remove the %LOC from that argument to eliminate it. For a lot of the Windows API definitions inherited from Microsoft,a lot of arguments were declared as integer by value when they were really something else by reference. This became a problem with x64 since the integer (address) size was different, so we changed these arguments to be REFERENCE and invented IGNORE_LOC to not break programs that passed %LOC(argument).
Did you assign a value to the function result variable? That would be my guess as to the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just added a simple routine that call the Print_Direct routine, see below.. I just removed the %LOC function and the I can compile without warnings. But the program crashes with the same message as befeore..
subroutine PrintFileDirect(PFile) ! 2/5-02 RJT !use Fortran_WinPrintDirect USE WinPrint_Direct ! 19/01-14 integer ii Character*(*) Pfile logical*4 printer Open(unit=3,file=PFile,form='FORMATTED',status='old',action='READ',err=999) !ii = Print_Direct (3,printer,i,i) ! QVF ii = Print_Direct (3,Default_Printer=.FALSE.) ! IVF close(unit=3) return !999 write(*,*)' *******Could not open the file ***********' 999 continue return end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't reproduce this. Could it be you have some project setting that is carried over from CVF? I'm wondering if you have a STDCALL-C mismatch that is corrupting the stack elsewhere in the program. Did you completely rebuild the project?
I tried your code with a simple jacket program of:
call PrintFileDirect('D:\Projects\compiler_f\Miscellaneous\WinPrint_Direct\data\test.prn') end
and it ran fine in a Debug configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I imported the project and upgraded to IVF. I changed some settings in the property menu to link a routine from IMSL. Currently the settings are as shown in the attachment..
Best regards, Reidar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You skipped the most important page - External Procedures. Just attach the .vfproj file, or show the Fortran > Command Line page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks foe comments Steve. Find attached the vfproj file...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok - I didn't see anything amiss there.
Have you modified the WinPrintDirect source in any way? The error message references a module procedure PPRINT_DIRECT, which doesn't exist in the sample.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have not modified the WinPrintDirect source any way to my own knowledge. To be sure that I am not working with a file in which something could be changed accidently the WinPrint_Direct_A is a fresh copy from the sample, only with my print routine added a the end
I have no variable or module named "PPRINT_DIRECT" in my source, at least nothing that is searchable, see below:
Find all "pprint_direct", Subfolders, Find Results 1, Entire Solution, "*.*"
Matching lines: 0 Matching files: 0 Total files searched: 30
The error message is a claim due to an undefined variable:
Run-Rime Check Failure. The variable '_WINPRINT_DIRECT_mp_PRINT_DIRECT$PRINT_DIRECT' is being used without being defined.
( In my post #3 is a type error, 'PPRINT_" is wrong, the actual message is as shown above, sorry for that mistake.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the correction. Can you attach a ZIP of a complete project that demonstrates the error? Also, which exact compiler version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using compiler:Intel(R) Visual Fortran Compiler XE 14.0.4.237 [IA-32]..
Is it possible that I could send the zip-file to a specific e-mail address?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wow - that's old. My guess then would be that you encountered a compiler bug related to uninitialized variable checking. In that case I suggest just disabling that option in the project properties (under Fortran > Run-Time) and forget about it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can make a "stripped" version of the project, a simple version that just demonstrate the problem...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that's what I would like to see.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached find the zipped project. When the program starts, select "Report" from the menu and then
print report..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Took me a while to get this to build - it uses IMSL (which I don't have) and a mismatched linker output, but I finally succeeded. It runs fine when built with 18.0.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So its a kind of compiler debug with regard to QWin ? There is maybe not a walk around in case of IVF 14.01...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
QWin? No. Just turn off uninitialized variable checking, as I suggested earlier.

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