打开对话框
CFileDialog cFilePath( TRUE,NULL,NULL,OFN_PATHMUSTEXIST,_T("VR Files (*.wrl)\0*.wrl\0All Files (*.*)\0*.*\0\0"));
WCHAR strBuffer[65535] = {0};cFilePath.m_ofn.lpstrFile = strBuffer;
cFilePath.m_ofn.nMaxFile = 65535;
if( cFilePath.DoModal() == IDOK )
{
LPWSTR lpFilePath = cFilePath.m_ofn.lpstrFile;
}
保存对话框
CFileDialog cFilePath( FALSE,NULL,NULL,OFN_PATHMUSTEXIST,_T("VR Files (*.wrl)\0*.wrl\0All Files (*.*)\0*.*\0\0"));
WCHAR strBuffer[65535] = {0};cFilePath.m_ofn.lpstrFile = strBuffer;
cFilePath.m_ofn.nMaxFile = 65535;
if( cFilePath.DoModal() == IDOK )
{
LPWSTR lpFilePath = cFilePath.m_ofn.lpstrFile;
}
本文详细介绍了如何使用CFileDialog类进行VR文件的打开和保存对话框操作,包括设置过滤器、获取文件路径等关键步骤。
3764

被折叠的 条评论
为什么被折叠?



