Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Finding volumes

Brooks_Van_Horn
New Contributor I
126 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
Black Belt
126 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

2 Replies
IanH
Black Belt
127 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

Brooks_Van_Horn
New Contributor I
126 Views

Thanks,

It is now in kernek32

Brooks

Reply