CMFCPropertyGridFileProperty Class

 

The latest version of this topic can be found at CMFCPropertyGridFileProperty Class.

The CMFCPropertyGridFileProperty class supports a property list control item that opens a file selection dialog box.

Syntax

class CMFCPropertyGridFileProperty : public CMFCPropertyGridProperty  

Members

Public Constructors

Name Description
CMFCPropertyGridFileProperty::CMFCPropertyGridFileProperty Constructs a CMFCPropertyGridFileProperty object.
CMFCPropertyGridFileProperty::~CMFCPropertyGridFileProperty Destructor.

Public Methods

Name Description
CMFCPropertyGridFileProperty::GetThisClass Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.
CMFCPropertyGridFileProperty::OnClickButton (Overrides CMFCPropertyGridProperty::OnClickButton.)

Remarks

Inheritance Hierarchy

CObject

CMFCPropertyGridProperty

CMFCPropertyGridFileProperty

Requirements

Header: afxpropertygridctrl.h

CMFCPropertyGridFileProperty::CMFCPropertyGridFileProperty

Constructs a CMFCPropertyGridFileProperty object.

CMFCPropertyGridFileProperty(
    const CString& strName,  
    BOOL bOpenFileDialog,  
    const CString& strFileName,  
    LPCTSTR lpszDefExt=NULL,  
    DWORD dwFlags=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,  
    LPCTSTR lpszFilter=NULL,  
    LPCTSTR lpszDescr=NULL,  
    DWORD_PTR dwData=0);

Parameters

[in] strName
The property name.

[in] bOpenFileDialog
TRUE to open an Open File dialog box; FALSE to open a Save File dialog box.

[in] strFileName
The initial file name.

[in] lpszDefExt
A string of one or more file name extensions. The default value is NULL.

[in] dwFlags
Dialog box flags. The default value is a bitwise combination (OR) of OFN_HIDEREADONLY and OFN_OVERWRITEPROMPT.

[in] lpszFilter
A string of one or more file filters. The default value is NULL.

[in] lpszDescr
The property item description. The default value is NULL.

[in] dwData
Application-specific data that is associated with the property item. For example, a 32-bit integer or a pointer to other data. The default value is 0.

Return Value

Remarks

For a full list of available flags, see OPENFILENAME structure.

Example

The following example demonstrates how to create an object using the constructor of the CMFCPropertyGridFileProperty class. This example is part of the Visual Studio Demo sample.

 // CMFCPropertyGridProperty* pGroup3
    static TCHAR BASED_CODE szFilter[] = _T("Icon Files(*.ico)|*.ico|All Files(*.*)|*.*||");
    pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Icon"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Specifies the dialog icon")));

See Also

Hierarchy Chart
Classes
CMFCPropertyGridCtrl Class
CMFCPropertyGridProperty Class