Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New User
71 Views

Problems with WinprintDirect

Jump to solution
 
0 Kudos

Accepted Solutions
Highlighted
Black Belt Retired Employee
61 Views

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.

View solution in original post

0 Kudos
21 Replies
Highlighted
Black Belt Retired Employee
61 Views

No problems? Great! :-)

 

0 Kudos
Highlighted
New User
61 Views

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..

0 Kudos
Highlighted
Black Belt
61 Views

Steve Lionel (Ret.) wrote:
 No problems? Great! :-) 

Steve, he probably posted his problem report using WinPrintDirect!

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

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. 

0 Kudos
Highlighted
New User
61 Views

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

 

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

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.

0 Kudos
Highlighted
New User
61 Views

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

 

 

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

You skipped the most important page - External Procedures. Just attach the .vfproj file, or show the Fortran > Command Line page.

0 Kudos
Highlighted
New User
61 Views

Thanks foe comments Steve. Find attached the vfproj file...

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

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.

0 Kudos
Highlighted
New User
61 Views

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.)

 

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

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?

0 Kudos
Highlighted
New User
61 Views

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?

0 Kudos
Highlighted
Black Belt Retired Employee
62 Views

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.

View solution in original post

0 Kudos
Highlighted
New User
61 Views

I can make  a "stripped" version of the project, a simple version that just demonstrate the problem...

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

Yes, that's what I would like to see.

0 Kudos
Highlighted
New User
61 Views

Attached find the zipped project. When the program starts, select "Report" from the menu and then

print report..

0 Kudos
Highlighted
Black Belt Retired Employee
61 Views

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.

0 Kudos
Highlighted
New User
61 Views

So its a kind of compiler debug with regard to QWin ?  There is maybe not a walk around in case of IVF 14.01...

 

0 Kudos