本文整理汇总了C++中CComQIPtr::Advise方法的典型用法代码示例。如果您正苦于以下问题:C++ CComQIPtr::Advise方法的具体用法?C++ CComQIPtr::Advise怎么用?C++ CComQIPtr::Advise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComQIPtr
的用法示例。
在下文中一共展示了CComQIPtr::Advise方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: put_swatches
STDMETHODIMP CSwatchesList::put_swatches(IPDSwatches *newVal)
{
DeselectAll();
if (m_swatches)
{
CComQIPtr<INotifySend> cp = m_swatches;
cp->Unadvise(this);
}
m_swatches = newVal;
if (m_swatches)
{
CComQIPtr<INotifySend> cp = m_swatches;
DWORD cookie;
cp->Advise(this, &cookie);
}
if (m_hWnd)
{
OnSize();
InvalidateRect(&m_areaRect);
}
return S_OK;
}
示例2: appendSubObject
STDMETHODIMP CPDObjectFrame::appendSubObject(IPDObjectWithBrush *object)
{
if (object == NULL) return E_INVALIDARG;
// TODO, remove from previous parent (if any)
object->AddRef();
CComQIPtr<IPDObject> o = object;
o->put_parent(this);
o->put_document(m_pDocument);
/*
{
CPDObjectImpl<IPDObject>* pObject = static_cast<CPDObjectImpl<IPDObject>*>(o.p);
pObject->CalculateBounds();
}
*/
CComQIPtr<INotifySend> cp = object;
DWORD cookie;
cp->Advise(this, &cookie);
m_subObjects->m_items.Add(o);
CComQIPtr<IPDObjectStroke> stroke = object;
CComQIPtr<IPDObjectFill> fill = object;
if (stroke)
m_activeStroke = stroke;
else
m_activeFill = fill;
return FireOnChanged(NOTIFY_ADD, object, DISPID_UNKNOWN);
}
示例3: put_textWrap
// TODO, move this code into CPDObjectWrappableImpl
STDMETHODIMP CPDObjectFrame::put_textWrap(/*[in]*/ PDTextWrap newVal)
{
if (m_textWrap != newVal)
{
m_textWrap = newVal;
if (m_wrapPath)
{
CComQIPtr<INotifySend> cp = m_wrapPath;
cp->Unadvise(this);
m_wrapPath->Release();
m_wrapPath = NULL;
}
m_editedWrapPath = FALSE;
if (m_textWrap == TEXTWRAP_SHAPE || m_textWrap == TEXTWRAP_BBOX)
{
CComObject<CPDPath>::CreateInstance(&m_wrapPath);
m_wrapPath->AddRef();
RecreateWrapPath();
CComQIPtr<INotifySend> cp = m_wrapPath;
DWORD cookie;
cp->Advise(this, &cookie);
}
// TODO notify ??
FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);
}
return S_OK;
}
示例4: put_content
STDMETHODIMP CPDObjectFrame::put_content(IPDObject *object)
{
object->AddRef();
// First remove it from previous parent
if (object)
{
CComPtr<IPDObjectUnknown> parent;
object->get_parent(&parent);
if (parent)
{
parent->removeObject(object);
}
}
// Remove previous content
if (m_content)
{
ATLASSERT(m_children->m_items.GetSize() == 1);
ATLASSERT(m_content == m_children->m_items[0]);
CComQIPtr<INotifySend> cp = m_content;
cp->Unadvise(this);
m_children->m_items.RemoveAll();
FireOnChanged(NOTIFY_REMOVE, m_content, DISPID_UNKNOWN);
m_content->Release();
m_content = NULL;
}
else
ATLASSERT(m_children->m_items.GetSize() == 0);
m_content = object;
if (m_content)
{
{
CPDObjectImpl<IPDObject>* pObject = static_cast<CPDObjectImpl<IPDObject>*>(m_content);
pObject->m_parent = static_cast<CPDObjectUnknownImpl<IPDObjectUnknown>*>((IPDObjectUnknown*)this);
pObject->attachToSpread(pObject->m_parent);
}
m_children->m_items.Add(m_content);
{
CComQIPtr<INotifySend> cp = m_content;
DWORD cookie;
cp->Advise(this, &cookie);
}
FireOnChanged(NOTIFY_ADD, m_content, DISPID_UNKNOWN);
}
//pObject->CalculateBounds(); // TODO Have this ???
return S_OK;
}
示例5: Connect
STDMETHODIMP CWgBHO::Connect()
{
HRESULT hr;
CComQIPtr <IConnectionPoint> spCP;
hr = m_spCPC->FindConnectionPoint (DIID_DWebBrowserEvents2, &spCP);
if (FAILED (hr))
return hr;
IWgBHO *pThis = (IWgBHO*) this;
hr = spCP->Advise (pThis, &m_dwCookie);
return S_OK;
}
示例6: put_symbol
STDMETHODIMP CPDObjectSymbolInstance::put_symbol(IPDSymbol *newVal)
{
if (m_symbol)
{
CComQIPtr<INotifySend> cp = m_symbol;
cp->Unadvise(this);
}
m_symbol = newVal;
if (m_symbol)
{
CComQIPtr<INotifySend> cp = m_symbol;
DWORD cookie;
cp->Advise(this, &cookie);
}
CalculateBounds();
return S_OK;
}
示例7: insertNode
//.........这里部分代码省略.........
elementTimeImpl->get_parentTimeContainer(&parentTimeContainer);
CComQIPtr<CLElementTimeContainerImplImpl> parentTimeContainerImpl((IUnknown*)parentTimeContainer);
if (parentTimeContainerImpl)
{
parentTimeContainerImpl->RecalculateTime();
}
elementTimeImpl->CalculateTimeAfterParent();
}
}
CComQIPtr<ILAnimationElement, &IID_ILAnimationElement> animation = (IUnknown*)newChild;
if (animation)
{
CComQIPtr<CLAnimationElementImplImpl> pAnimation((IUnknown*)animation);
pAnimation->SetValuesFromAttributes();
}
#endif
{
#if 0 // TODO
for (int i = 0; i < m_pNodes.GetSize(); i++)
{
ASSERT(0);
m_pNodes[i]->OnInsertedChild(newChild);
}
#endif
#if 0
if (TRUE) // TODO, probably remove this (use above loop only)
{
CComQIPtr<INotifySend, &IID_INotifySend> cp = newChild;
if (cp)
{
CComQIPtr<INotifyGet, &IID_INotifyGet> get = (IUnknown*)thisNode;
if (get)
{
DWORD cookie;
cp->Advise(get, &cookie);
}
cp->FireOnChanged(NOTIFY_ADD, newChild, DISPID_UNKNOWN);
}
}
#endif
}
// CComPtr<ILDOMDocument> ownerDocument;
// newChild->get_ownerDocument(&ownerDocument);
// if (ownerDocument)
{
////////////////////////////////
// create an event notification
DocumentEvent* ownerDocumentEvent = dynamic_cast<DocumentEvent*>(m_ownerDocument);
if (ownerDocumentEvent == NULL)
ownerDocumentEvent = dynamic_cast<DocumentEvent*>(this);
if (ownerDocumentEvent)
{
MutationEvent* event = dynamic_cast<MutationEvent*>(ownerDocumentEvent->createEvent(S("MutationEvent")));
EventTarget* eventTarget = dynamic_cast<EventTarget*>(newChild);
//
event->initMutationEvent(S("DOMNodeInserted"), true, false, this, nullptr, nullptr, nullptr, CHANGE_UNKNOWN);
bool doDefault = eventTarget->dispatchEvent(event);
if (IsDocumentOrPartOfDocument(this))
{
// Send "DOMNodeInsertedIntoDocument" to the node and it's children
NodeInsertedIntoDocument(newChild);
}
}
{
Node* p = this;
while (p)
{
if (p->m_pNode)
{
p->m_pNode->m_bArrangeValid = false;
}
p = p->get_parentNode();
}
}
#if 0
//
event->initMutationEvent(OLESTR("DOMSubtreeModified"), VARIANT_TRUE, VARIANT_FALSE, thisNode, NULL, NULL, NULL, CHANGE_UNKNOWN);
eventTarget->dispatchEvent(event, &doDefault);
#endif
}
return newChild;
}