【C#声明】
[DllImport("user32")]
private static extern IntPtr CharToOem (string lpszSrc, string lpszDst);
【VB声明】
private Declare Function CharToOem Lib "user32" (ByVal lpszSrc As String, ByVal lpszDst As String) As Long
【参数】
lpszSrc -------- String,欲转换的字串
lpszDst -------- String,用于包含转换结果的OEM字串。注意事先将字串初始化成合适的长度。可将相同的字串传递给这两个参数,执行本地转换(即在同一个字串中转换)
cchDstLength
Long,在字串lpszSrc中想转换的字符数量
【返回值】
Long,肯定是TRUE
【功能】
将一个字串从ANSI字符集转换到OEM字符集。CharToOemBuff允许我们指定字串中需转换的字符数量
【提醒】
如用一个Win32类型库访问宽字符函数CharToOemW,则lpszSrc是一个Unicode字串,且lpszDst参数绝对不能与lpszSrc相同