Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Various compilation errors

davidgraham
Beginner
1,747 Views
I am making progress on converting from cvf to ivf. I have now just got some compilation errors due to my prevoius poor programming. These are the ones I have been unable to sort out.

Problem 1

error #6284: There is no matching specific function for this generic function reference. [RGB]

integer*4 c
integer*2 i1,i2,i3
c=RGB(i1,i2,i3)

Looking at the documentation i1,i2 & i3 should be byte, I tried using cbyte(i1) but still got the error. Maybe c is the wrong type.

Problem 2

error #8212: Omitted field is not initialized. Field initialization missing: [LPRESERVED]

TI=T_TTTOOLINFO(32,TTF_IDISHWND,hWnd,GetDlgItem(hWnd,IDCommand(i)),Rect,0,LOC(szTool(i)),0)

This is a routine to set up tool tips.
I couldn't find any documentation so I'm not sure what is wrong with the call.

Problem 3
warning #6075: The data type of the actual argument does not match the definition. [LDRAW]

integer*4 hExag
logical*4 lret, ldraw
lret=EnableWindow(hExag,ldraw)

The documentation says ldraw should be boolean. I thought that was logical*4.

The code below works.
if (ldraw) then
lret=EnableWindow(hExag,.TRUE.)
else
lret=EnableWindow(hExag,.FALSE.)
end if

What am I doing wrong?

Thanks for your help.
0 Kudos
6 Replies
Paul_Curtis
Valued Contributor I
1,747 Views
[bash]!   wrapper function to convert supplied INTEGER*4 color values
!   to BYTE format required by Win32 API function RGB
INTEGER FUNCTION Make_RGB (red, grn, blu)
    IMPLICIT NONE
    INTEGER, INTENT(IN)     :: red, grn, blu
    Make_RGB = RGB (INT1(red), INT1(grn), INT1(blu))
END FUNCTION Make_RGB
[/bash]


[bash]!	tooltips
TYPE(T_TTTOOLINFO)	   :: ti
INTEGER(HANDLE)		   :: hTT_version

!	tooltip info structure for program version report
ti%cbSize      = SIZEOF(ti)
ti%hwnd        = hwnd
ti%uId	       = 1
rval = SendMessage (hTT_version, TTM_DELTOOL, 0, LOC(ti))	! just in case
ti%rect%left   = 4
ti%rect%top    = clientRect%top         ! - logoHeight
ti%rect%bottom = clientRect%bottom      ! + logoHeight
ti%rect%right  = ti%Rect%left + logoWidth
ti%hinst       = NULL

!   for callback tooltip
!ti%uFlags   = IOR(TTF_IDISHWND, TTF_SUBCLASS)
!ti%lpszText = LPSTR_TEXTCALLBACKA

!   for static tooltop
ti%uFlags      = TTF_SUBCLASS
ti%lpszText    = LOC(nullb) !LOC(versionstring)

rval = SendMessage (hTT_version, TTM_ADDTOOL, 0, LOC(ti))
rval = SendMessage (hTT_version, TTM_SETTITLE, info_icon, LOC(versionstring))
rval = SendMessage (hTT_version, TTM_SETMAXTIPWIDTH, 0, 200)
[/bash]



The 2nd argument for EnableWindow() is either TRUE or FALSE (no surrounding period delimiters), which are defined Win32 constant values. These are different from the Fortran logicals .TRUE. and .FALSE.
0 Kudos
davidgraham
Beginner
1,747 Views
Thanks, all those solutions worked.

For T_TTTOOLINFO I just added another parameter - not sure if that is correct but it compiled.

TI=T_TTTOOLINFO(32,TTF_IDISHWND,hWnd,GetDlgItem(hWnd,IDCommand(i)),Rect,0,LOC(szTool(i)),0,0)
0 Kudos
davidgraham
Beginner
1,747 Views
I now only have a few warnings & messages when I compile.
The whole process of upgrading has been easier than with the VB projects where several areas had to be re-written.

One that I cannot understant is:

warning #8043: The extra characters in the format specification will be ignored ['(A,I7,I4,5X,I7,I4,2F12.3))']

The code is

write (99,'(A,I7,I4,5X,I7,I4,2F12.3))') 'Text',ifea,ifea_fc,jfea,kfc,dble(x)/1d3,dble(y)/1d3

I cannot see what the problem is.

A is 'Text'
I7 is ifea
I4 is ifea_fc
5X are 5 spaces
I7 is jfea
I4 is kfc
2F12.3 is dble(x)/1d3 & dble(y)/1d3

Is there a problem?

Thanks

0 Kudos
Arjen_Markus
Honored Contributor II
1,747 Views
I think it has to do with the second parenthesis.

Regards,

Arjen
0 Kudos
Steven_L_Intel1
Employee
1,747 Views
You have two closing parenthesis after the F12.3 - should be only one.
0 Kudos
davidgraham
Beginner
1,747 Views
Thanks, that's it sorted.
0 Kudos
Reply