Bagikan melalui


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.

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")));

Requirements

Header: afxpropertygridctrl.h

See Also

Reference

CMFCPropertyGridFileProperty Class

Hierarchy Chart