2、其次在“推荐的程序”和“其他程序”中找有没有VCMicrosoft(R)DeveloperStudio,如果没找到,就用“浏览”去找VC的EXE文件。
3、然后选定工具后,一定记住在下面设成ON:始终使用选择的程序打开这种文件。
4、最后点击确定即可。
加上头文件#include <commdlg.h>其格式如下
OPENFILENAME ofn
char path[MAX_PATH]
static TCHAR szFilter[] = TEXT ("Text Files (*.TXT)\0*.txt\0") \
TEXT ("ASCII Files (*.ASC)\0*.asc\0") \
TEXT ("All Files (*.*)\0*.*\0\0")
ofn.lStructSize = sizeof (OPENFILENAME)
ofn.hwndOwner = hwnd
ofn.hInstance = NULL
ofn.lpstrFilter = szFilter
ofn.lpstrCustomFilter = NULL
ofn.nMaxCustFilter = 0
ofn.nFilterIndex = 0
ofn.nMaxFile = MAX_PATH
ofn.nMaxFileTitle = MAX_PATH
ofn.lpstrInitialDir = NULL
ofn.lpstrTitle = NULL
ofn.Flags = 0 // Set in Open and Close functions
ofn.nFileOffset = 0
ofn.nFileExtension = 0
ofn.lpstrDefExt = TEXT ("txt")
ofn.lCustData = 0L
ofn.lpfnHook = NULL
ofn.lpTemplateName = NULL
ofn.hwndOwner = hwnd
ofn.lpstrFile = path
ofn.lpstrFileTitle = NULL
ofn.Flags = OFN_HIDEREADONLY | OFN_CREATEPROMPT
GetOpenFileName (&ofn) //打开文件对话框
GetSaveFileName(&ofn)//保存文件对话框
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)