-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMyFileDialog.cpp
43 lines (35 loc) · 1.26 KB
/
MyFileDialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// MyFileDialog.cpp: implementation of the CMyFileDialog class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "chitem.h"
#include "MyFileDialog.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMyFileDialog::CMyFileDialog(BOOL bOpenFileDialog,LPCTSTR lpszDefExt,LPCTSTR lpszFileName,
DWORD dwFlags,LPCTSTR lpszFilter, CWnd *pParentWnd) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
//use the newer commdlg version
if ((DWORD)(LOBYTE(LOWORD(::GetVersion())))>=5) {
if (m_ofn.lStructSize==76) {
m_ofn.lStructSize = 88;
}
}
//increase the buffer size
if (m_ofn.nMaxFile<MAXBUFFSIZE)
{
strncpy(external,m_ofn.lpstrFile,MAXBUFFSIZE);
m_ofn.lpstrFile=external;
m_ofn.nMaxFile=MAXBUFFSIZE/32; //this should be divided by MAX_PATH, but that would be too small, if someone uses long filenames they deserve the crash
}
};
CMyFileDialog::~CMyFileDialog()
{
}