<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic About WideCharToMultiByte (Win32 API) in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035234#M111698</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;I have converted the MBCS(ANSI/UTF8) to Widecharacter using MultiByteToWideChar successfully.&lt;BR /&gt;
	But when I convert it back to MBCS(ANSI/UTF8) using WideCharToMultiByte, it always return zero(fails).&lt;BR /&gt;
	I am using Intel(R) Visual FORTRAN Compiler XE 12.1.7.371 [IA-32] and Intel(R) Visual FORTRAN Compiler XE 14.0.4.237 [IA-32].&amp;nbsp;&lt;BR /&gt;
	The results are the same.&lt;/P&gt;

&lt;P&gt;Please help me.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Oct 2014 16:44:52 GMT</pubDate>
    <dc:creator>Mincheol_L_</dc:creator>
    <dc:date>2014-10-24T16:44:52Z</dc:date>
    <item>
      <title>About WideCharToMultiByte (Win32 API)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035234#M111698</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;I have converted the MBCS(ANSI/UTF8) to Widecharacter using MultiByteToWideChar successfully.&lt;BR /&gt;
	But when I convert it back to MBCS(ANSI/UTF8) using WideCharToMultiByte, it always return zero(fails).&lt;BR /&gt;
	I am using Intel(R) Visual FORTRAN Compiler XE 12.1.7.371 [IA-32] and Intel(R) Visual FORTRAN Compiler XE 14.0.4.237 [IA-32].&amp;nbsp;&lt;BR /&gt;
	The results are the same.&lt;/P&gt;

&lt;P&gt;Please help me.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 16:44:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035234#M111698</guid>
      <dc:creator>Mincheol_L_</dc:creator>
      <dc:date>2014-10-24T16:44:52Z</dc:date>
    </item>
    <item>
      <title>Can you provide us with a</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035235#M111699</link>
      <description>&lt;P&gt;Can you provide us with a small test case?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 17:40:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035235#M111699</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-24T17:40:35Z</dc:date>
    </item>
    <item>
      <title>Hello Steve</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035236#M111700</link>
      <description>&lt;P&gt;Hello Steve&lt;/P&gt;

&lt;P&gt;I made a small test case.&lt;BR /&gt;
	Please find the attached file.&lt;BR /&gt;
	Thanks a lot.&lt;/P&gt;

&lt;P&gt;** note **&lt;BR /&gt;
	acp.f90 -&amp;gt; saved as US-ASCII (Codepage 20127)&lt;BR /&gt;
	utf8.f90 -&amp;gt; saved as Unicode (UTF8 with signature) (Codepage 65001)&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2014 12:25:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035236#M111700</guid>
      <dc:creator>Mincheol_L_</dc:creator>
      <dc:date>2014-10-25T12:25:00Z</dc:date>
    </item>
    <item>
      <title>I tried composing an example</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035237#M111701</link>
      <description>&lt;P&gt;I tried composing an example in gfortran:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module ifwina
&amp;nbsp;&amp;nbsp; use ISO_C_BINDING
&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp; integer, parameter :: UINT = C_INT, DWORD = C_LONG, WCHAR = C_INT16_T
&amp;nbsp;&amp;nbsp; integer, parameter :: BOOL = C_INT
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_ACP = 0
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_MACCP = 2
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_OEMCP = 1
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_SYMBOL = 42
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_THREAD_ACP = 3
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_UTF7 = 65000
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_UTF8 = 65001
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_COMPOSITE = 2
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_ERR_INVALID_CHARS = 8
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_PRECOMPOSED = 1
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_USEGLYPHCHARS = 4
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_COMPOSITECHECK = 512
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_ERR_INVALID_CHARS = 128
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_NO_BEST_FIT_CHARS = 1024
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function MultiByteToWideChar(CodePage,dwFlags,lpMultiByteStr, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cbMultiByte,lpWideCharStr,cchWideChar) bind(C,name='MultiByteToWideChar')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: MultiByteToWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: MultiByteToWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT) MultiByteToWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(UINT), value :: CodePage
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(DWORD), value :: dwFlags
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR) lpMultiByteStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cbMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(WCHAR) lpWideCharStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cchWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function MultiByteToWideChar
&amp;nbsp;&amp;nbsp; end interface
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function WideCharToMultiByte(CodePage,dwFlags,lpWideCharStr, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cchWideChar,lpMultiByteStr,cbMultiByte,lpDefaultChar, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpUsedDefaultChar) bind(C,name='WideCharToMultiByte')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: WideCharToMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: WideCharToMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT) WideCharToMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(UINT), value :: CodePage
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(DWORD), value :: dwFlags
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(WCHAR) lpWideCharStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cchWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR) lpMultiByteStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cbMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR) lpDefaultChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(BOOL) lpUsedDefaultChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function WideCharToMultiByte
&amp;nbsp;&amp;nbsp; end interface
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function GetLastError() bind(C,name='GetLastError')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: GetLastError
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: GetLastError
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(DWORD) GetLastError
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function GetLastError
&amp;nbsp;&amp;nbsp; end interface
end module ifwina

program mbcs
&amp;nbsp;&amp;nbsp; use ifwina
&amp;nbsp;&amp;nbsp; use ISO_C_BINDING
&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp; integer(C_INT) iret1
&amp;nbsp;&amp;nbsp; integer(DWORD) iret2
&amp;nbsp;&amp;nbsp; character(LEN=256,KIND=C_CHAR) lpMultiByteStr
&amp;nbsp;&amp;nbsp; integer(WCHAR) lpWideCharStr(LEN(lpMultiByteStr))
&amp;nbsp;&amp;nbsp; integer(UINT) CodePage
&amp;nbsp;&amp;nbsp; integer(DWORD) dwFlags
&amp;nbsp;&amp;nbsp; integer(C_INT) cbMultiByte
&amp;nbsp;&amp;nbsp; integer(C_INT) cchWideChar
&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR), pointer :: lpDefaultChar
&amp;nbsp;&amp;nbsp; integer(BOOL), pointer :: lpUsedDefaultChar

&amp;nbsp;&amp;nbsp; CodePage = CP_UTF8
&amp;nbsp;&amp;nbsp; dwFlags = MB_ERR_INVALID_CHARS
&amp;nbsp;&amp;nbsp; lpMultiByteStr = 'Hello world'//ACHAR(0)
&amp;nbsp;&amp;nbsp; cbMultiByte = -1
&amp;nbsp;&amp;nbsp; lpWideCharStr = lpWideCharStr
&amp;nbsp;&amp;nbsp; cchWideChar = size(lpWideCharStr)
&amp;nbsp;&amp;nbsp; iret1 = MultiByteToWideChar(CodePage,dwFlags, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpMultiByteStr,cbMultiByte,lpWideCharStr,cchWideChar)
&amp;nbsp;&amp;nbsp; if(iret1 == 0) then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret2 = GetLastError()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'MultiByteToWideChar failed with error code ',iret2
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0,a)') 'MultiByteToWideChar converted ',iret1,' characters'
&amp;nbsp;&amp;nbsp; end if
&amp;nbsp;&amp;nbsp; lpMultiByteStr = ''
&amp;nbsp;&amp;nbsp; dwFlags = WC_ERR_INVALID_CHARS
&amp;nbsp;&amp;nbsp; cbMultiByte = len(lpMultiByteStr)
&amp;nbsp;&amp;nbsp; call C_F_POINTER(C_NULL_PTR,lpDefaultChar)
&amp;nbsp;&amp;nbsp; call C_F_POINTER(C_NULL_PTR,lpUsedDefaultChar)
&amp;nbsp;&amp;nbsp; cchWideChar = -1
&amp;nbsp;&amp;nbsp; iret1 = WideCharToMultiByte(CodePage,dwFlags,lpWideCharStr,cchWideChar, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpMultiByteStr,cbMultiByte,lpDefaultChar,lpUsedDefaultChar)
&amp;nbsp;&amp;nbsp; if(iret1 == 0) then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret2 = GetLastError()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'WideCharToMultiByte failed with error code ',iret2
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0,a)') 'MultiByteToWideChar converted ',iret1,' characters'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a)') 'lpMultiByteStr = ',lpMultiByteStr(1:index(lpMultiByteStr,ACHAR(0))-1)
&amp;nbsp;&amp;nbsp; end if
end program mbcs
&lt;/PRE&gt;

&lt;P&gt;It worked, so I compared with your example and noticed that you passed a NULL pointer to the lpMultiByteStr argument of WideCharToMultiByte. When you get problems like this, you should check the error code returned by GetLastError which should be 122 for ERROR_INSUFFICIENT_BUFFER in this case.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2014 15:36:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035237#M111701</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2014-10-25T15:36:17Z</dc:date>
    </item>
    <item>
      <title>It looks like I was a little</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035238#M111702</link>
      <description>&lt;P&gt;It looks like I was a little too hasty in my previous remark. lpMultiByteStr can be NULL if cbMultiByte is zero, which it was in your example. I have modified my example to do this and also to use a MesssageBoxW to print out the WCHAR string. I still don't get any errors. What does GetLastError return after the call to WideCharToMultiByte? Does my example work on your machine? Can you copy ifort's interface block (from kernel32.f90); maybe there is some problem with it. OK, looking at an old version of ifort's interface block, I see a problem: ifort doesn't include the ALLOW_NULL attribute for the lpUsedDefaultChar argument, so if this is still the case with current ifort, the compiler will&amp;nbsp;send a non-NULL address for lpUsedDefaultChar and GetLastError should be returning 87 for ERROR_INVALID_PARAMETER. You can work around this by setting a pointer to point at what C_NULL_PTR points at and passing that as in the usage of lpUsedDefaultChar in my example, expanded below:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module ifwina
&amp;nbsp;&amp;nbsp; use ISO_C_BINDING
&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp; integer, parameter :: UINT = C_INT, DWORD = C_LONG, WCHAR = C_INT16_T
&amp;nbsp;&amp;nbsp; integer, parameter :: BOOL = C_INT, HANDLE = C_INTPTR_T
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_ACP = 0
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_MACCP = 2
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_OEMCP = 1
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_SYMBOL = 42
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_THREAD_ACP = 3
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_UTF7 = 65000
&amp;nbsp;&amp;nbsp; integer(UINT), parameter :: CP_UTF8 = 65001
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_COMPOSITE = 2
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_ERR_INVALID_CHARS = 8
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_PRECOMPOSED = 1
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: MB_USEGLYPHCHARS = 4
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_COMPOSITECHECK = 512
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_ERR_INVALID_CHARS = 128
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_NO_BEST_FIT_CHARS = 1024
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_DEFAULTCHAR = 64
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_DISCARDNS = 16
&amp;nbsp;&amp;nbsp; integer(DWORD), parameter :: WC_SEPCHARS = 32
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ABORTRETRYIGNORE = 2
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_CANCELTRYCONTINUE = 6
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_HELP = 16384
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_OK = 0
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_OKCANCEL = 1
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_RETRYCANCEL = 5
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_YESNO = 4
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_YESNOCANCEL = 3
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONEXCLAMATION = 48
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONWARNING = 48
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONINFORMATION = 64
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONASTERISK = 64
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONQUESTION = 32
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONSTOP = 16
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONERROR = 16
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_ICONHAND = 16
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_DEFBUTTON1 = 0
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_DEFBUTTON2 = 256
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_DEFBUTTON3 = 512
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_DEFBUTTON4 = 768
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_APPLMODAL = 0
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_SYSTEMMODAL = 4096
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_TASKMODAL = 8192
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_DEFAULT_DESKTOP_ONLY = 131072
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_RIGHT = 524288
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_RTLREADING = 1048576
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_SETFOREGROUND = 65536
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_TOPMOST = 262144
&amp;nbsp;&amp;nbsp; integer(C_INT), parameter :: MB_SERVICE_NOTIFICATION = 2097152
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function MultiByteToWideChar(CodePage,dwFlags,lpMultiByteStr, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cbMultiByte,lpWideCharStr,cchWideChar) bind(C,name='MultiByteToWideChar')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: MultiByteToWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: MultiByteToWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT) MultiByteToWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(UINT), value :: CodePage
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(DWORD), value :: dwFlags
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR) lpMultiByteStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cbMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(WCHAR) lpWideCharStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cchWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function MultiByteToWideChar
&amp;nbsp;&amp;nbsp; end interface
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function WideCharToMultiByte(CodePage,dwFlags,lpWideCharStr, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cchWideChar,lpMultiByteStr,cbMultiByte,lpDefaultChar, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpUsedDefaultChar) bind(C,name='WideCharToMultiByte')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: WideCharToMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: WideCharToMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT) WideCharToMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(UINT), value :: CodePage
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(DWORD), value :: dwFlags
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(WCHAR) lpWideCharStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cchWideChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR) lpMultiByteStr(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT), value :: cbMultiByte
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR) lpDefaultChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(BOOL) lpUsedDefaultChar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function WideCharToMultiByte
&amp;nbsp;&amp;nbsp; end interface
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function GetLastError() bind(C,name='GetLastError')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: GetLastError
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: GetLastError
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(DWORD) GetLastError
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function GetLastError
&amp;nbsp;&amp;nbsp; end interface
&amp;nbsp;&amp;nbsp; interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function MessageBoxW(hWnd,lpTExt,lpCaption,uType) bind(C,name='MessageBoxW')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !GCC$ ATTRIBUTES STDCALL :: MessageBoxW
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES STDCALL :: MessageBoxW
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(C_INT) MessageBoxW
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(HANDLE), value :: hWnd
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(WCHAR) lpText(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(WCHAR) lpCaption(*)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer(UINT), value :: uType
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end function MessageBoxW
&amp;nbsp;&amp;nbsp; end interface
end module ifwina

program mbcs
&amp;nbsp;&amp;nbsp; use ifwina
&amp;nbsp;&amp;nbsp; use ISO_C_BINDING
&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp; integer(C_INT) iret1
&amp;nbsp;&amp;nbsp; integer(DWORD) iret2
&amp;nbsp;&amp;nbsp; character(LEN=256,KIND=C_CHAR) lpMultiByteStr
&amp;nbsp;&amp;nbsp; integer(WCHAR) lpWideCharStr(LEN(lpMultiByteStr))
&amp;nbsp;&amp;nbsp; integer(UINT) CodePage
&amp;nbsp;&amp;nbsp; integer(DWORD) dwFlags
&amp;nbsp;&amp;nbsp; integer(C_INT) cbMultiByte
&amp;nbsp;&amp;nbsp; integer(C_INT) cchWideChar
&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR), pointer :: lpDefaultChar
&amp;nbsp;&amp;nbsp; integer(BOOL), pointer :: lpUsedDefaultChar
&amp;nbsp;&amp;nbsp; integer(HANDLE) hWnd
&amp;nbsp;&amp;nbsp; integer(WCHAR), pointer :: lpCaption(:)
&amp;nbsp;&amp;nbsp; integer(UINT) uType
&amp;nbsp;&amp;nbsp; character(KIND=C_CHAR), pointer :: lpNULL(:)

&amp;nbsp;&amp;nbsp; CodePage = CP_UTF8
&amp;nbsp;&amp;nbsp; dwFlags = MB_ERR_INVALID_CHARS
&amp;nbsp;&amp;nbsp; lpMultiByteStr = 'Hello world'//ACHAR(0)
&amp;nbsp;&amp;nbsp; cbMultiByte = -1
&amp;nbsp;&amp;nbsp; lpWideCharStr = lpWideCharStr
&amp;nbsp;&amp;nbsp; cchWideChar = size(lpWideCharStr)
&amp;nbsp;&amp;nbsp; iret1 = MultiByteToWideChar(CodePage,dwFlags, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpMultiByteStr,cbMultiByte,lpWideCharStr,cchWideChar)
&amp;nbsp;&amp;nbsp; if(iret1 == 0) then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret2 = GetLastError()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'MultiByteToWideChar failed with error code ',iret2
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0,a)') 'MultiByteToWideChar converted ',iret1,' characters'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hWnd = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call C_F_POINTER(C_NULL_PTR,lpCaption,[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uType = iany([MB_OK,MB_ICONINFORMATION])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret1 = MessageBoxW(hWnd,lpWideCharStr,lpCaption,uType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(iret1 == 0) then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret2 = GetLastError()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'MessageBoxW failed with error code ',iret2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'MessageBoxW returned code ', iret1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if
&amp;nbsp;&amp;nbsp; end if
&amp;nbsp;&amp;nbsp; lpMultiByteStr = ''
&amp;nbsp;&amp;nbsp; dwFlags = 0
&amp;nbsp;&amp;nbsp; cbMultiByte = 0
&amp;nbsp;&amp;nbsp; call C_F_POINTER(C_NULL_PTR,lpDefaultChar)
&amp;nbsp;&amp;nbsp; call C_F_POINTER(C_NULL_PTR,lpUsedDefaultChar)
&amp;nbsp;&amp;nbsp; cchWideChar = -1
&amp;nbsp;&amp;nbsp; call C_F_POINTER(C_NULL_PTR,lpNULL,[0])
&amp;nbsp;&amp;nbsp; iret1 = WideCharToMultiByte(CodePage,dwFlags,lpWideCharStr,cchWideChar, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpNULL,cbMultiByte,lpDefaultChar,lpUsedDefaultChar)
&amp;nbsp;&amp;nbsp; if(iret1 == 0) then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret2 = GetLastError()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'WideCharToMultiByte failed with error code ',iret2
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0,a)') 'WideCharToMultiByte requires a ',iret1,' character buffer'
&amp;nbsp;&amp;nbsp; end if
&amp;nbsp;&amp;nbsp; dwFlags = WC_ERR_INVALID_CHARS
&amp;nbsp;&amp;nbsp; cbMultiByte = len(lpMultiByteStr)
&amp;nbsp;&amp;nbsp; iret1 = WideCharToMultiByte(CodePage,dwFlags,lpWideCharStr,cchWideChar, &amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpMultiByteStr,cbMultiByte,lpDefaultChar,lpUsedDefaultChar)
&amp;nbsp;&amp;nbsp; if(iret1 == 0) then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iret2 = GetLastError()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0)') 'WideCharToMultiByte failed with error code ',iret2
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(a,i0,a)') 'MultiByteToWideChar converted ',iret1,' characters'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(2a)') 'lpMultiByteStr = ',lpMultiByteStr(1:index(lpMultiByteStr,ACHAR(0))-1)
&amp;nbsp;&amp;nbsp; end if
end program mbcs
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2014 17:31:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035238#M111702</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2014-10-25T17:31:26Z</dc:date>
    </item>
    <item>
      <title>RO is exactly right in his</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035239#M111703</link>
      <description>&lt;P&gt;RO is exactly right in his diagnosis. An easier workaround is to replace the NULL by %VAL(0) for the last argument.&lt;/P&gt;

&lt;P&gt;I'll get this fixed in KERNEL32 (and will check the related declarations to see if there are similar problems.)&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2014 23:46:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035239#M111703</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-25T23:46:32Z</dc:date>
    </item>
    <item>
      <title>Thinking about the situation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035240#M111704</link>
      <description>&lt;P&gt;Thinking about the situation a little more, maybe it's a weakness in the properties of !DEC$ ATTRIBUTES ALLOW_NULL. In a situation like this, if you want to pass FALSE (from ifwinty) as actual argument and ALLOW_NULL were in force, you would have to use %REF(FALSE) because the extension is documented to pass C_NULL_PTR by value if the actual argument is zero. As we have seen, if ALLOW_NULL is not in force and we want to pass C_NULL_PTR by value, we need %VAL(C_NULL_PTR). If we pass %VAL(0), does the ABI guarantee that the high 32 bits of the dummy argument on the stack are cleared to zeros in a 64-bit environment?&lt;/P&gt;

&lt;P&gt;In any case it seems to be sort of a darned if you do, darned if you don't situation if the dummy argument is int* and (void *)0 and a pointer to zero are both acceptable arguments. Kind of like the problem with OPTIONAL, VALUE that led to ifort switching how it handled passing VALUE arguments to be 'by reference to a copy' instead of true value. I don't know how to fix this otherwise useful ALLOW_NULL extension and not be left with confusing cases where the compiler does something unexpected without warning unless you look at ifort's corresponding interface block as well as MSDN's documentation of the function each time you use the extension.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Oct 2014 02:04:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035240#M111704</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2014-10-26T02:04:09Z</dc:date>
    </item>
    <item>
      <title>The problem with VALUE was</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035241#M111705</link>
      <description>&lt;P&gt;The problem with VALUE was simply a misunderstanding of what the standard said. OPTIONAL had nothing to do with it. But your general point is well taken. Perhaps what we'll have to do is add a comment in kernel32.f90 explaining how to omit that argument (%VAL(0)).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Oct 2014 21:41:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035241#M111705</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-26T21:41:02Z</dc:date>
    </item>
    <item>
      <title>I was also a bit too hasty -</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035242#M111706</link>
      <description>&lt;P&gt;I was also a bit too hasty - ALLOW_NULL is exactly the right fix for this. Why isn't the situation RO describes a problem? Because this is an output argument - you'll never be passing a FALSE value IN to the routine here. You either supply the address of a BOOL-sized integer variable, or NULL. If you supply a constant NULL (or FALSE), it is't writable so you'll get the error anyway (which is what is happening here.)&lt;/P&gt;

&lt;P&gt;With ALLOW_NULL, passing NULL means omitting the argument. Otherwise you have to pass a variable. I have escalated this to development as issue&amp;nbsp;DPD200362551.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2014 19:21:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035242#M111706</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-27T19:21:57Z</dc:date>
    </item>
    <item>
      <title>RegQueryValueEx</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035243#M111707</link>
      <description>&lt;PRE class="brush:plain;"&gt;RegQueryValueEx
XInputGetAudioDeviceIds
SetFilePointer
recvfrom
RegEnumKeyEx
CryptDecryptMessage and related...
WlanGetProfile
InternetSetFilePointer
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 14:48:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035243#M111707</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2014-10-28T14:48:32Z</dc:date>
    </item>
    <item>
      <title>RO, have you looked at the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035244#M111708</link>
      <description>&lt;P&gt;RO, have you looked at the documentation of those procedures to see if a problem actually exists? For example, in RegQueryValueEx I assume you're referring to lpcbData, which is an INOUT size of the lpData buffer. ALLOW_NULL, which is specified here, isn't a problem for the same reason as I describe above - you can't pass a constant 0 for this argument and expect anything useful.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 15:27:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035244#M111708</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-28T15:27:01Z</dc:date>
    </item>
    <item>
      <title>I only have a very old</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035245#M111709</link>
      <description>&lt;P&gt;I only have a very old version of advapi32.f90 so I can't check from here. I just did a google search for Win32 API functions with intent inout and optional integer arguments and that's what it turned up. I can't check further without more significant effort here.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 17:46:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035245#M111709</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2014-10-28T17:46:17Z</dc:date>
    </item>
    <item>
      <title>Ok, I thought maybe you did</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035246#M111710</link>
      <description>&lt;P&gt;Ok, I thought maybe you did that. Certainly those are potential problem candidates, but I haven't yet found other routines where an actual problem exists.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 19:13:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/About-WideCharToMultiByte-Win32-API/m-p/1035246#M111710</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-28T19:13:21Z</dc:date>
    </item>
  </channel>
</rss>

