コード例 #1
0
TEST(iDataObjectTest,Simple)
{
	IDataObject *pDataObject = NULL;
	CreateDataObject(NULL,NULL,&pDataObject,0);

	FORMATETC ftc;
	ftc.cfFormat	= CF_TEXT;
	ftc.dwAspect	= DVASPECT_CONTENT;
	ftc.lindex		= -1;
	ftc.ptd			= NULL;
	ftc.tymed		= TYMED_HGLOBAL;
	EXPECT_EQ(DV_E_FORMATETC,pDataObject->QueryGetData(&ftc));

	EXPECT_EQ(E_NOTIMPL,pDataObject->DAdvise(NULL,ADVF_NODATA,NULL,NULL));
	EXPECT_EQ(OLE_E_ADVISENOTSUPPORTED,pDataObject->DUnadvise(0));
	EXPECT_EQ(OLE_E_ADVISENOTSUPPORTED,pDataObject->EnumDAdvise(NULL));
}
コード例 #2
0
ファイル: PyIDataObject.cpp プロジェクト: Logan-lu/pywin32
// @pymethod |PyIDataObject|DUnadvise|Disconnects a notification sink.
PyObject *PyIDataObject::DUnadvise(PyObject *self, PyObject *args)
{
	IDataObject *pIDO = GetI(self);
	if ( pIDO == NULL )
		return NULL;
	// @pyparm int|dwConnection||Identifier of the connection as returned by DAdvise.
	DWORD dwConnection;
	if ( !PyArg_ParseTuple(args, "l:DUnadvise", &dwConnection) )
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pIDO->DUnadvise( dwConnection );
	PY_INTERFACE_POSTCALL;
	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
	Py_INCREF(Py_None);
	return Py_None;
}