•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,488 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,734 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 8738 | Replies: 1
![]() |
•
•
Join Date: Aug 2004
Posts: 1
Reputation:
Rep Power: 0
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
3d apple blue screen cocoa computer crash dell development drivers email enterprise eudora firefox framework games gnu graphics ibm intel internet java linux microsoft microsystems mozilla news next open open source open-source opengl openoffice operating os penelope programming red hat rhel server software source step sun super system ubuntu vista wesnoth windows xp
- open save dialog box error (PHP)
- How a doc file can be open inside browser without prompting the download dialog box (ASP.NET)
- File Download Dialog Box(ASP) (ASP)
- Opening a .pdf file at the clientside without the open/save dialog box (ASP.NET)
- file open dialog box control in asp.net (ASP.NET)
- Dialog box missing when sending attachments. (Windows NT / 2000 / XP / 2003)
Other Threads in the C++ Forum
- Previous Thread: Need Help: basic problems...
- Next Thread: Icons


Linear Mode