| | |
Common Open dialog box
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2004
Posts: 1
Reputation:
Solved Threads: 0
Hi.
How can I call common open dialog box in MS Visual C++ 6.0 ?
I tried to use getOpenFileName() and CreateFile(). But my function doesn't work.
There is tehe body:
void FlashProgram::OnButtonPOpen()
{
// TODO: Add your control notification handler code here
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HWND hwnd; // owner window
HANDLE hf; // file handle
// I nitialize OPENFILENAME
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.hex\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
// Display the Open dialog box.
if (GetOpenFileName(&ofn)==TRUE)
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,(HANDLE) NULL);
}
Can You give me any helps or hints
Or example? :o
More Thanks
Milan
How can I call common open dialog box in MS Visual C++ 6.0 ?
I tried to use getOpenFileName() and CreateFile(). But my function doesn't work.
There is tehe body:
void FlashProgram::OnButtonPOpen()
{
// TODO: Add your control notification handler code here
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HWND hwnd; // owner window
HANDLE hf; // file handle
// I nitialize OPENFILENAME
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.hex\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
// Display the Open dialog box.
if (GetOpenFileName(&ofn)==TRUE)
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,(HANDLE) NULL);
}
Can You give me any helps or hints
Or example? :o
More Thanks
Milan
![]() |
Similar Threads
- Everything just gives 'Open With' dialog box (Windows NT / 2000 / XP)
- How to create a File Open Dialog Box (C)
- open save dialog box error (PHP)
- File details in to List View using a file dialog box (C#)
- how to open a file without clicking run button in the file download dialog box (Java)
- Save dialog box (Visual Basic 4 / 5 / 6)
- file open dialog box control in asp.net (ASP.NET)
Other Threads in the C++ Forum
- Previous Thread: Need Help: basic problems...
- Next Thread: Icons
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data database delete desktop developer directshow dll download dynamic encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





