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

Finding volumes

Brooks_Van_Horn
New Contributor I
505 Views

In IVF 2016 I was able to declare:

interface
    function FindFirstVolume(lpszVolumeName,cchBufferLength)
    import
    !DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE, ALIAS:"FindFirstVolumeA" :: FindFirstVolume
    integer(HANDLE) :: FindFirstVolume
    character(*), intent(OUT) :: lpszVolumeName
    integer(DWORD), intent(IN) :: cchBufferLength
    !DEC$ ATTRIBUTES VALUE :: cchBufferLength
    end function FindFirstVolume
 
    function FindNextVolume(hFindVolume,lpszVolumeName,cchBufferLength)
    import
    !DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE, ALIAS:"FindNextVolumeA" :: FindNextVolume
    integer(BOOL) :: FindNextVolume
    integer(HANDLE), intent(IN) :: hFindVolume
    !DEC$ ATTRIBUTES VALUE :: hFindVolume
    character(*), intent(OUT) :: lpszVolumeName
    !DEC$ ATTRIBUTES REFERENCE :: lpszVolumeName
    integer(DWORD), intent(IN) :: cchBufferLength
    !DEC$ ATTRIBUTES VALUE :: cchBufferLength
    end function FindNextVolume
 
    function FindVolumeClose(hFindVolume)
    import
    !DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE, ALIAS:"FindVolumeClose" :: FindVolumeClose
    integer(BOOL) :: FindVolumeClose
    integer(HANDLE), intent(IN) :: hFindVolume
    !DEC$ ATTRIBUTES VALUE :: hFindVolume
    end function FindVolumeClose
 
end interface

 

nut i get an error in 2017. What has changed?

Brooks

 

0 Kudos
1 Solution
IanH
Honored Contributor II
505 Views

I'll guess (given the absence of any details about the "error") that the relevant API's have been added to the Intel provided Windows API modules (IFWIN and friends), that you have a USE statement for such a module in the same scope as those interface bodies, and the the names of the added API's and the names in your interface bodies now clash.

View solution in original post

0 Kudos
2 Replies
IanH
Honored Contributor II
506 Views

I'll guess (given the absence of any details about the "error") that the relevant API's have been added to the Intel provided Windows API modules (IFWIN and friends), that you have a USE statement for such a module in the same scope as those interface bodies, and the the names of the added API's and the names in your interface bodies now clash.

0 Kudos
Brooks_Van_Horn
New Contributor I
505 Views

Thanks,

It is now in kernek32

Brooks

0 Kudos
Reply