- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want use the function SetThreadPreferredUILanguages() in a Fortran routine. It needs two/three parameters as follows:
[in] DWORD dwFlags,
[in, optional] PCZZWSTR pwszLanguagesBuffer,
[out, optional] PULONG pulNumLanguages
The first parameter can simply be set to MUI_LANGUAGE_NAME. However, I have trouble finding out the correct Fortran types for the second and third parameter.
When used as
Use ISO_C_BINDING
Integer(Bool) :: bRet
bRet = SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, NULL, NULL)
it returns a TRUE so the function does work in principle.
When I use it as
Use ISO_C_BINDING
Integer(Bool) :: bRet
Character(15), Pointer :: p_string
Character(15), Target :: string
string = "fr-FR"//Char(0)//"nl-NL"//Char(0)//Char(0)
p_string => string
bRet = SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, p_string, NULL)
it returns a FALSE indicating that it is called incorrectly I assume. But what is the right way of providing the parameters?
Forgot to mention: I use an interface like
interface
logical(4) function SetProcessPreferredUILanguages(mode, lan, nlan)
!DEC$ATTRIBUTES STDCALL, ALIAS: '_SetProcessPreferredUILanguages@4':: SetProcessPreferredUILanguages
!DEC$ATTRIBUTES REFERENCE :: nlan, lan
integer(4) :: mode
character(*) :: lan
integer :: nlan
end function
end interface
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page