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

FULLAPI

John_N_2
Beginner
583 Views
Dear Steve:

[cpp]integer*4 function fullapi()
!dec$objcomment lib:"user32.lib"
!dec$objcomment lib:"gdi32.lib"
!dec$objcomment lib:"advapi32.lib"
!dec$objcomment lib:"wsock32.lib"
!dec$objcomment lib:"comdlg32.lib"
!dec$objcomment lib:"shell32.lib"
!dec$objcomment lib:"version.lib"
!dec$objcomment lib:"mpr.lib"
!dec$objcomment lib:"lz32.lib"
!dec$objcomment lib:"winspool.lib"
!dec$objcomment lib:"winmm.lib"
!dec$objcomment lib:"scrnsave.lib"
fullapi = 0
end[/cpp]
The include file fullapi.f90 has the code shown above. Can you confirm that if I call this function I get the full api available in the program unit?

Can you also confirm the usage for RGB Macro as I am unable to get it compile without error on type required for RGB?

JMN
0 Kudos
2 Replies
Paul_Curtis
Valued Contributor I
583 Views
Quoting - MacNeacail
Dear Steve:

[cpp]integer*4 function fullapi()
!dec$objcomment lib:"user32.lib"
!dec$objcomment lib:"gdi32.lib"
!dec$objcomment lib:"advapi32.lib"
!dec$objcomment lib:"wsock32.lib"
!dec$objcomment lib:"comdlg32.lib"
!dec$objcomment lib:"shell32.lib"
!dec$objcomment lib:"version.lib"
!dec$objcomment lib:"mpr.lib"
!dec$objcomment lib:"lz32.lib"
!dec$objcomment lib:"winspool.lib"
!dec$objcomment lib:"winmm.lib"
!dec$objcomment lib:"scrnsave.lib"
fullapi = 0
end[/cpp]
The include file fullapi.f90 has the code shown above. Can you confirm that if I call this function I get the full api available in the program unit?

Can you also confirm the usage for RGB Macro as I am unable to get it compile without error on type required for RGB?

JMN

No, that is not the way you do it. IVF supplies Win32 API interface modules in the default search path, which may be USEd by your program. You can simply USE ifwin, or select subsets of ifwin:

[cpp]MODULE globals
	
	!   these are the contents of ifwin, omitting wsock32;
	!   this program's winsock module USEs ws2_32.f90 instead,
	!   and we thus need to avoid conflicts with wsock32.f90
    USE advapi32
    USE comdlg32
    USE ifwbase
    USE gdi32
    USE kernel32
    !use lz32
    !use mpr      ! WNet connection APIs, not used by this program
    USE shell32
    USE user32
    !use version
    !use winmm    ! Windows multimedia APIs, not used by this program
    USE winspool
    
    !   Win32 types and defines
    USE ifwinty[/cpp]

The Win32 function RGB transforms 3 INT(1) arguments into a single INT(4) result. Perhaps this will be clearer from the reverse transform:

[cpp]!   extract the components from the supplied colorRef
red   = RSHFT(IAND(RGB, Z'00FF0000'), 16)
green = RSHFT(IAND(RGB, Z'0000FF00'),  8)
blue  =       IAND(RGB, Z'000000FF')
[/cpp]

0 Kudos
Wendy_Doerner__Intel
Valued Contributor I
583 Views
Since you addressed this post to Steve, just wanted to let you know he will be out for a couple of days. Looks though like you have had some good help on this.

Wendy
0 Kudos
Reply