description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CDataPathProperty Class |
CDataPathProperty Class |
11/04/2016 |
|
|
1f96efdb-54e4-460b-862c-eba5d4103488 |
Implements an OLE control property that can be loaded asynchronously.
class CDataPathProperty : public CAsyncMonikerFile
Name | Description |
---|---|
CDataPathProperty::CDataPathProperty | Constructs a CDataPathProperty object. |
Name | Description |
---|---|
CDataPathProperty::GetControl | Retrieves the asynchronous OLE control associated with the CDataPathProperty object. |
CDataPathProperty::GetPath | Retrieves the pathname of the property. |
CDataPathProperty::Open | Initiates loading of the asynchronous property for the associated ActiveX (OLE) control. |
CDataPathProperty::ResetData | Calls CAsyncMonikerFile::OnDataAvailable to notify the container that the control properties have changed. |
CDataPathProperty::SetControl | Sets the asynchronous ActiveX (OLE) control associated with the property. |
CDataPathProperty::SetPath | Sets the pathname of the property. |
Asynchronous properties are loaded after synchronous initiation.
The class CDataPathProperty
is derived from CAysncMonikerFile
. To implement asynchronous properties in your OLE controls, derive a class from CDataPathProperty
, and override OnDataAvailable.
For more information about how to use asynchronous monikers and ActiveX controls in Internet applications, see the following articles:
CDataPathProperty
Header: afxctl.h
Constructs a CDataPathProperty
object.
CDataPathProperty(COleControl* pControl = NULL);
CDataPathProperty(LPCTSTR lpszPath, COleControl* pControl = NULL);
pControl
A pointer to the OLE control object to be associated with this CDataPathProperty
object.
lpszPath
The path, which may be absolute or relative, used to create an asynchronous moniker that references the actual absolute location of the property. CDataPathProperty
uses URLs, not filenames. If you want a CDataPathProperty
object for a file, prepend file://
to the path.
The COleControl
object pointed to by pControl is used by Open
and retrieved by derived classes. If pControl is NULL, the control used with Open
should be set with SetControl
. If lpszPath is NULL, you can pass in the path through Open
or set it with SetPath
.
Call this member function to retrieve the COleControl
object associated with the CDataPathProperty
object.
COleControl* GetControl();
Returns a pointer to the OLE control associated with the CDataPathProperty
object. NULL if not control is associated.
Call this member function to retrieve the path, set when the CDataPathProperty
object was constructed, or specified in Open
, or specified in a previous call to the SetPath
member function.
CString GetPath() const;
Returns the pathname to the property itself. Can be empty if no path has been specified.
Call this member function to initiate loading of the asynchronous property for the associated control.
virtual BOOL Open(
COleControl* pControl,
CFileException* pError = NULL);
virtual BOOL Open(
LPCTSTR lpszPath,
COleControl* pControl,
CFileException* pError = NULL);
virtual BOOL Open(
LPCTSTR lpszPath,
CFileException* pError = NULL);
virtual BOOL Open(CFileException* pError = NULL);
pControl
A pointer to the OLE control object to be associated with this CDataPathProperty
object.
pError
A pointer to a file exception. In the event of an error, will be set to the cause.
lpszPath
The path, which may be absolute or relative, used to create an asynchronous moniker that references the actual absolute location of the property. CDataPathProperty
uses URLs, not filenames. If you want a CDataPathProperty
object for a file, prepend file://
to the path.
Nonzero if successful; otherwise 0.
The function attempts to obtain the IBindHost
interface from the control.
Before calling Open
without a path, the value for the property's path must be set. This can be done when the object is constructed, or by calling the SetPath
member function.
Before calling Open
without a control, an ActiveX control (formerly known as an OLE control) can be associated with the object. This can be done when the object is constructed, or by calling SetControl
.
All overloads of CAsyncMonikerFile::Open are also available from CDataPathProperty
.
Call this function to get CAsyncMonikerFile::OnDataAvailable
to notify the container that the control properties have changed, and all the information loaded asynchronously is no longer useful.
virtual void ResetData();
Opening should be restarted. Derived classes can override this function for different defaults.
Call this member function to associate an asynchronous OLE control with the CDataPathProperty
object.
void SetControl(COleControl* pControl);
pControl
A pointer to the asynchronous OLE control to be associated with the property.
Call this member function to set the pathname of the property.
void SetPath(LPCTSTR lpszPath);
lpszPath
A path, which may be absolute or relative, to the property being loaded asynchronously. CDataPathProperty
uses URLs, not filenames. If you want a CDataPathProperty
object for a file, prepend file://
to the path.
MFC Sample Image
CAsyncMonikerFile Class
Hierarchy Chart
CAsyncMonikerFile Class