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

How to action GetOpenFileNameW wide Win32 API

MikeWinsteps
Novice
144 Views

Folks, I need to access Korean folders and file names using a dialog box. IFORT 2024.2 with VS2022 does not recognize GetOpenFileNameW Win32 API. How do I do it?

0 Kudos
3 Replies
Steve_Lionel
Honored Contributor III
116 Views

None of the W functions are declared because Intel Fortran doesn't support wide characters. You can declare the function yourself, but you'll also have to declare the OPENFILENAMEW structure. Look at the declarations of the A versions in commdlg32.f90 and ifwinty.f90 as a basis.

A word of caution - the function documentation I linked to above incorrectly gives OPENFILENAME as the structure type, but as suggested in "Syntax", it is actually OPENFILENAMEW.

 

0 Kudos
MikeWinsteps
Novice
30 Views

Thanks, Steve:

 

Success to far:

OPENFILENAMEW structure - is already defined, Good.

GetOpenFileNameW interface constructed, modeled on comdlg32.f90 - good!

Source code now compiles OK with GetOpenFileNameW

 

Problem: Linker reports "unresolved external symbol GETOPENFILENAMEW"

GetOpenFileNameW is a name in ComDlg32.lib, but perhaps I am not looking at the same one as IFORT uses. Where does IFORT look for ComDlg32.lib?

 

Any other suggestions anyone?

0 Kudos
Steve_Lionel
Honored Contributor III
6 Views

If you'll look at the source for comdlg32.f90, you'll see that each routine uses an ATTRIBUTES DECORATE,STDCALL,ALIAS directive to give the mixed-case name of the function. You haven't done that so you get the default upcasing. You should be able to adapt the GetOpenFIleNameA declaration and make the minor edits for the W version.

0 Kudos
Reply