(1)打开文件对话框
CFileDialog cFilePath( TRUE,NULL,NULL,OFN_SHAREAWARE,_T("VR Files (*.wrl)\0*.wrl\0All Files (*.*)\0*.*||")
);
WCHAR strBuffer[65535] = {0};
cFilePath.m_ofn.lpstrFile = strBuffer;
cFilePath.m_ofn.nMaxFile = 65535;
if( cFilePath.DoModal() == IDOK )
{
}
(2)保存文件对话框
CFileDialog cFilePath(FALSE,"wrl",NULL,OFN_SHAREAWARE,_T("VR Files(*.wrl)\0*.wrl"));
char strBuffer[65535] = {0};
cFilePath.m_ofn.lpstrFile = strBuffer;
cFilePath.m_ofn.nMaxFile = 65535;
if( cFilePath.DoModal() == IDOK )
{
}
二.MFC中CFileDialog的使用
(1)打开文件对话框
(2)保存文件对话框
以"\0"分割,最后的过滤器字符串必须以两个"\0"字符结尾.
到的文字,并不具有过滤功能.如果要有过滤功能,必须在其后加上"\0"字符,并随后加上"*.txt"字符串.