BOOL GetOpenFileName(LPOPENFILENAME lpofn); 需要一个LPOPENFILENAME
lpofn
[in, out] Pointer to an OPENFILENAME structure that contains information used to initialize the dialog box. When GetOpenFileName returns, this structure contains information about the user's file selection.定义一个OPENFILENAME结构OPENFILENAME aaa;::GetOpenFileNameA (aaa);GetOpenFileNameA”: 不能将参数 1 从“OPENFILENAME”转换为“LPOPENFILENAMEA”很郁闷啊 怎么转换 微软弄这么多结构干什么
还有啊 LPWSTR 类型 是 WCHAR 定义的 WCHAR_T 定义的麻烦不啊
wchar_t b;
aaa.lpstrFile= (LPWSTR)b;(LPWSTR)b 这样是什么意思?
lpofn
[in, out] Pointer to an OPENFILENAME structure that contains information used to initialize the dialog box. When GetOpenFileName returns, this structure contains information about the user's file selection.定义一个OPENFILENAME结构OPENFILENAME aaa;::GetOpenFileNameA (aaa);GetOpenFileNameA”: 不能将参数 1 从“OPENFILENAME”转换为“LPOPENFILENAMEA”很郁闷啊 怎么转换 微软弄这么多结构干什么
还有啊 LPWSTR 类型 是 WCHAR 定义的 WCHAR_T 定义的麻烦不啊
wchar_t b;
aaa.lpstrFile= (LPWSTR)b;(LPWSTR)b 这样是什么意思?
无法从“wchar_t”转换为“LPWSTR”
::GetOpenFileNameA(&aaa);OPENFILENAMEW aaa;
::GetOpenFileNameW(&aaa);OPENFILENAME aaa;
::GetOpenFileName(&aaa);三种都可以,第一种是ANSI下用的,第二种需要UNICODE,第三种是2种字符集下都可以使用,一般我们会用第三种。保证代码以后更改为UNICODE不会报错。