您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CallQueryInterface函数代码示例

51自学网 2021-06-01 20:09:04
  C++
这篇教程C++ CallQueryInterface函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CallQueryInterface函数的典型用法代码示例。如果您正苦于以下问题:C++ CallQueryInterface函数的具体用法?C++ CallQueryInterface怎么用?C++ CallQueryInterface使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CallQueryInterface函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: NS_NewDOMNotifyPaintEvent

nsresult NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult,                                   mozilla::dom::EventTarget* aOwner,                                   nsPresContext* aPresContext,                                   nsEvent *aEvent,                                   uint32_t aEventType,                                   nsInvalidateRequestList* aInvalidateRequests) {  nsDOMNotifyPaintEvent* it =    new nsDOMNotifyPaintEvent(aOwner, aPresContext, aEvent, aEventType,                              aInvalidateRequests);  if (nullptr == it) {    return NS_ERROR_OUT_OF_MEMORY;  }  return CallQueryInterface(it, aInstancePtrResult);}
开发者ID:BitVapor,项目名称:Pale-Moon,代码行数:16,


示例2: CheckExpandoObject

static inline void CheckExpandoObject(JSObject* proxy,                                      const JS::Value& expando) {#ifdef DEBUG  JSObject* obj = &expando.toObject();  MOZ_ASSERT(!js::gc::EdgeNeedsSweepUnbarriered(&obj));  MOZ_ASSERT(js::GetObjectCompartment(proxy) == js::GetObjectCompartment(obj));  // When we create an expando object in EnsureExpandoObject below, we preserve  // the wrapper. The wrapper is released when the object is unlinked, but we  // should never call these functions after that point.  nsISupports* native = UnwrapDOMObject<nsISupports>(proxy);  nsWrapperCache* cache;  CallQueryInterface(native, &cache);  MOZ_ASSERT(cache->PreservingWrapper());#endif}
开发者ID:Noctem,项目名称:gecko-dev,代码行数:16,


示例3: NS_NewCSSImportRule

nsresultNS_NewCSSImportRule(nsICSSImportRule** aInstancePtrResult,                     const nsString& aURLSpec,                    nsMediaList* aMedia){  NS_ENSURE_ARG_POINTER(aInstancePtrResult);  CSSImportRuleImpl* it = new CSSImportRuleImpl(aMedia);  if (! it) {    return NS_ERROR_OUT_OF_MEMORY;  }  it->SetURLSpec(aURLSpec);  return CallQueryInterface(it, aInstancePtrResult);}
开发者ID:ahadzi,项目名称:celtx,代码行数:16,


示例4: NS_ASSERTION

nsresultnsXMLDocument::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const{  NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager,               "Can't import this document into another document!");  nsRefPtr<nsXMLDocument> clone = new nsXMLDocument();  NS_ENSURE_TRUE(clone, NS_ERROR_OUT_OF_MEMORY);  nsresult rv = CloneDocHelper(clone);  NS_ENSURE_SUCCESS(rv, rv);  // State from nsXMLDocument  clone->mAsync = mAsync;  return CallQueryInterface(clone.get(), aResult);}
开发者ID:Web5design,项目名称:mozilla-central,代码行数:16,


示例5: GetFrame

/* void openMenu (in boolean openFlag); */NS_IMETHODIMP nsMenuBoxObject::OpenMenu(PRBool aOpenFlag){  nsIFrame* frame = GetFrame();  if (!frame)    return NS_OK;  if (!nsPopupSetFrame::MayOpenPopup(frame))    return NS_OK;  nsIMenuFrame* menuFrame;  CallQueryInterface(frame, &menuFrame);  if (!menuFrame)    return NS_OK;  return menuFrame->OpenMenu(aOpenFlag);}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:17,


示例6: NS_ENSURE_ARG

nsresult nsMailboxService::CopyMessages(PRUint32 aNumKeys,                                        nsMsgKey* aMsgKeys,                                        nsIMsgFolder *srcFolder,                                        nsIStreamListener * aMailboxCopyHandler,                                        bool moveMessage,                                        nsIUrlListener * aUrlListener,                                        nsIMsgWindow *aMsgWindow,                                        nsIURI **aURL){  nsresult rv = NS_OK;  NS_ENSURE_ARG(srcFolder);  NS_ENSURE_ARG(aMsgKeys);  nsCOMPtr<nsIMailboxUrl> mailboxurl;  nsMailboxAction actionToUse = nsIMailboxUrl::ActionMoveMessage;  if (!moveMessage)     actionToUse = nsIMailboxUrl::ActionCopyMessage;  nsCOMPtr <nsIMsgDBHdr> msgHdr;  nsCOMPtr <nsIMsgDatabase> db;  srcFolder->GetMsgDatabase(getter_AddRefs(db));  if (db)  {    db->GetMsgHdrForKey(aMsgKeys[0], getter_AddRefs(msgHdr));    if (msgHdr)    {      nsCString uri;      srcFolder->GetUriForMsg(msgHdr, uri);      rv = PrepareMessageUrl(uri.get(), aUrlListener, actionToUse , getter_AddRefs(mailboxurl), aMsgWindow);      if (NS_SUCCEEDED(rv))      {        nsCOMPtr<nsIURI> url = do_QueryInterface(mailboxurl);        nsCOMPtr<nsIMsgMailNewsUrl> msgUrl (do_QueryInterface(url));        nsCOMPtr<nsIMailboxUrl> mailboxUrl (do_QueryInterface(url));        msgUrl->SetMsgWindow(aMsgWindow);        mailboxUrl->SetMoveCopyMsgKeys(aMsgKeys, aNumKeys);        rv = RunMailboxUrl(url, aMailboxCopyHandler);      }    }  }  if (aURL && mailboxurl)    CallQueryInterface(mailboxurl, aURL);  return rv;}
开发者ID:mikeconley,项目名称:comm-central,代码行数:47,


示例7: CreateContext

already_AddRefed<nsISupports>CanvasRenderingContextHelper::GetContext(JSContext* aCx,                                         const nsAString& aContextId,                                         JS::Handle<JS::Value> aContextOptions,                                         ErrorResult& aRv){  CanvasContextType contextType;  if (!CanvasUtils::GetCanvasContextType(aContextId, &contextType))    return nullptr;  if (!mCurrentContext) {    // This canvas doesn't have a context yet.    RefPtr<nsICanvasRenderingContextInternal> context;    context = CreateContext(contextType);    if (!context) {      return nullptr;    }    // Ensure that the context participates in CC.  Note that returning a    // CC participant from QI doesn't addref.    nsXPCOMCycleCollectionParticipant* cp = nullptr;    CallQueryInterface(context, &cp);    if (!cp) {      aRv.Throw(NS_ERROR_FAILURE);      return nullptr;    }    mCurrentContext = context.forget();    mCurrentContextType = contextType;    nsresult rv = UpdateContext(aCx, aContextOptions, aRv);    if (NS_FAILED(rv)) {      // See bug 645792 and bug 1215072.      // We want to throw only if dictionary initialization fails,      // so only in case aRv has been set to some error value.      return nullptr;    }  } else {    // We already have a context of some type.    if (contextType != mCurrentContextType)      return nullptr;  }  nsCOMPtr<nsICanvasRenderingContextInternal> context = mCurrentContext;  return context.forget();}
开发者ID:kitcambridge,项目名称:gecko-dev,代码行数:46,


示例8: NS_WARNING

already_AddRefed<nsIModelElementPrivate>nsXFormsInstanceElement::GetModel(){  if (!mElement)  {    NS_WARNING("The XTF wrapper element has been destroyed");    return nsnull;  }  nsCOMPtr<nsIDOMNode> parentNode;  mElement->GetParentNode(getter_AddRefs(parentNode));  nsIModelElementPrivate *model = nsnull;  if (parentNode)    CallQueryInterface(parentNode, &model);  return model;}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:17,


示例9: NS_ASSERTION

already_AddRefed<nsIDocShellTreeItem>nsCoreUtils::GetDocShellTreeItemFor(nsINode *aNode){  if (!aNode)    return nsnull;  nsIDocument *doc = aNode->GetOwnerDoc();  NS_ASSERTION(doc, "No document for node passed in");  NS_ENSURE_TRUE(doc, nsnull);  nsCOMPtr<nsISupports> container = doc->GetContainer();  nsIDocShellTreeItem *docShellTreeItem = nsnull;  if (container)    CallQueryInterface(container, &docShellTreeItem);  return docShellTreeItem;}
开发者ID:gorakhargosh,项目名称:mozilla-central,代码行数:17,


示例10: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPnsFileProtocolHandler::NewFileURI(nsIFile *file, nsIURI **result){    NS_ENSURE_ARG_POINTER(file);    nsresult rv;    nsCOMPtr<nsIFileURL> url = new nsStandardURL(true);    if (!url)        return NS_ERROR_OUT_OF_MEMORY;    // NOTE: the origin charset is assigned the value of the platform    // charset by the SetFile method.    rv = url->SetFile(file);    if (NS_FAILED(rv)) return rv;    return CallQueryInterface(url, result);}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:17,


示例11: NS_ENSURE_ARG_POINTER

NS_IMETHODIMP nsSHEnumerator::GetNext(nsISupports **aItem){  NS_ENSURE_ARG_POINTER(aItem);  PRInt32 cnt= 0;  nsresult  result = NS_ERROR_FAILURE;  mSHistory->GetCount(&cnt);  if (mIndex < (cnt-1)) {    mIndex++;    nsCOMPtr<nsIHistoryEntry> hEntry;    result = mSHistory->GetEntryAtIndex(mIndex, PR_FALSE, getter_AddRefs(hEntry));    if (hEntry)      result = CallQueryInterface(hEntry, aItem);  }  return result;}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:17,


示例12: CallQueryInterface

NS_IMETHODIMPnsSVGPatternFrame::DidModifySVGObservable(nsISVGValue* observable,                                           nsISVGValue::modificationType aModType){  nsIFrame *pattern = nsnull;  CallQueryInterface(observable, &pattern);  // Is this a pattern we are observing that is going away?  if (mNextPattern && aModType == nsISVGValue::mod_die && pattern) {    // Yes, we need to handle this differently    if (mNextPattern == pattern) {      mNextPattern = nsnull;    }  }  // Something we depend on was modified -- pass it on!  DidModify(aModType);  return NS_OK;}
开发者ID:ahadzi,项目名称:celtx,代码行数:17,


示例13: NS_ASSERTION

// staticJSObject*DOMProxyHandler::EnsureExpandoObject(JSContext* cx, JS::Handle<JSObject*> obj){    NS_ASSERTION(IsDOMProxy(obj), "expected a DOM proxy object");    JS::Value v = js::GetProxyExtra(obj, JSPROXYSLOT_EXPANDO);    if (v.isObject()) {        return &v.toObject();    }    js::ExpandoAndGeneration* expandoAndGeneration;    if (!v.isUndefined()) {        expandoAndGeneration = static_cast<js::ExpandoAndGeneration*>(v.toPrivate());        if (expandoAndGeneration->expando.isObject()) {            return &expandoAndGeneration->expando.toObject();        }    } else {        expandoAndGeneration = nullptr;    }    JS::Rooted<JSObject*> expando(cx,                                  JS_NewObjectWithGivenProto(cx, nullptr, nullptr, js::GetObjectParent(obj)));    if (!expando) {        return nullptr;    }    nsISupports* native = UnwrapDOMObject<nsISupports>(obj);    nsWrapperCache* cache;    CallQueryInterface(native, &cache);    if (expandoAndGeneration) {        cache->PreserveWrapper(native);        expandoAndGeneration->expando.setObject(*expando);        return expando;    }    XPCWrappedNativeScope* scope = xpc::GetObjectScope(obj);    if (!scope->RegisterDOMExpandoObject(obj)) {        return nullptr;    }    cache->SetPreservingWrapper(true);    js::SetProxyExtra(obj, JSPROXYSLOT_EXPANDO, ObjectValue(*expando));    return expando;}
开发者ID:smacgregor,项目名称:mozilla-central,代码行数:46,


示例14: weakFrame

NS_IMETHODIMPnsPopupSetFrame::DestroyPopup(nsIFrame* aPopup, PRBool aDestroyEntireChain){  if (!mPopupList)    return NS_OK; // No active popups  nsPopupFrameList* entry = mPopupList->GetEntryByFrame(aPopup);  if (entry && entry->mCreateHandlerSucceeded) {    // ensure the popup was created before we try to destroy it    nsWeakFrame weakFrame(this);    OpenPopup(entry, PR_FALSE);    nsCOMPtr<nsIContent> popupContent = entry->mPopupContent;    if (weakFrame.IsAlive()) {      if (aDestroyEntireChain && entry->mElementContent && entry->mPopupType.EqualsLiteral("context")) {        // If we are a context menu, and if we are attached to a        // menupopup, then destroying us should also dismiss the parent        // menu popup.        if (entry->mElementContent->Tag() == nsXULAtoms::menupopup) {          nsIFrame* popupFrame = nsnull;          mPresContext->PresShell()->GetPrimaryFrameFor(entry->mElementContent,                                                        &popupFrame);          if (popupFrame) {            nsIMenuParent *menuParent;            if (NS_SUCCEEDED(CallQueryInterface(popupFrame, &menuParent))) {              menuParent->DismissChain();            }          }        }      }        // clear things out for next time      entry->mPopupType.Truncate();      entry->mCreateHandlerSucceeded = PR_FALSE;      entry->mElementContent = nsnull;      entry->mXPos = entry->mYPos = 0;      entry->mLastPref.width = -1;      entry->mLastPref.height = -1;    }    // ungenerate the popup.    popupContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, PR_TRUE);  }  return NS_OK;}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:45,


示例15: NS_ENSURE_ARG

NS_IMETHODIMPsbDirectoryProvider::GetFile(const char *aProp,                             PRBool *aPersistent,                             nsIFile **_retval){  NS_ENSURE_ARG(aProp);  NS_ENSURE_ARG_POINTER(aPersistent);  NS_ENSURE_ARG_POINTER(_retval);  nsCOMPtr<nsILocalFile> localFile;  nsresult rv = NS_ERROR_FAILURE;  *_retval = nsnull;  *aPersistent = PR_TRUE;#if defined (XP_WIN)  if (strcmp(aProp, NS_WIN_COMMON_DOCUMENTS) == 0)    rv = GetWindowsFolder(CSIDL_COMMON_DOCUMENTS, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_COMMON_PICTURES) == 0)    rv = GetWindowsFolder(CSIDL_COMMON_PICTURES, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_COMMON_MUSIC) == 0)    rv = GetWindowsFolder(CSIDL_COMMON_MUSIC, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_COMMON_VIDEO) == 0)    rv = GetWindowsFolder(CSIDL_COMMON_VIDEO, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_DOCUMENTS) == 0)    rv = GetWindowsFolder(CSIDL_MYDOCUMENTS, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_PICTURES) == 0)    rv = GetWindowsFolder(CSIDL_MYPICTURES, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_MUSIC) == 0)    rv = GetWindowsFolder(CSIDL_MYMUSIC, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_VIDEO) == 0)    rv = GetWindowsFolder(CSIDL_MYVIDEO, getter_AddRefs(localFile));  else if (strcmp(aProp, NS_WIN_DISCBURNING) == 0)    rv = GetWindowsFolder(CSIDL_CDBURN_AREA, getter_AddRefs(localFile));#endif // XP_WIN  if (NS_SUCCEEDED(rv)) {    if (localFile)      rv = CallQueryInterface(localFile, _retval);    else      rv = NS_ERROR_FAILURE;  }  return rv;}
开发者ID:AntoineTurmel,项目名称:nightingale-hacking,代码行数:45,


示例16: do_CreateInstance

nsresultWSPProxy::WrapInPropertyBag(nsISupports* aInstance,                            nsIInterfaceInfo* aInterfaceInfo,                            nsIPropertyBag** aPropertyBag){  *aPropertyBag = nsnull;  nsresult rv;  nsCOMPtr<nsIWebServiceComplexTypeWrapper> wrapper =    do_CreateInstance(NS_WEBSERVICECOMPLEXTYPEWRAPPER_CONTRACTID, &rv);  if (NS_FAILED(rv)) {    return rv;  }  rv = wrapper->Init(aInstance, aInterfaceInfo);  if (NS_FAILED(rv)) {    return rv;  }  return CallQueryInterface(wrapper, aPropertyBag);}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:18,


示例17: NS_NewCSSNameSpaceRule

nsresultNS_NewCSSNameSpaceRule(nsICSSNameSpaceRule** aInstancePtrResult,                        nsIAtom* aPrefix, const nsString& aURLSpec){  if (! aInstancePtrResult) {    return NS_ERROR_NULL_POINTER;  }  CSSNameSpaceRuleImpl* it = new CSSNameSpaceRuleImpl();  if (! it) {    return NS_ERROR_OUT_OF_MEMORY;  }  it->SetPrefix(aPrefix);  it->SetURLSpec(aURLSpec);  return CallQueryInterface(it, aInstancePtrResult);}
开发者ID:ahadzi,项目名称:celtx,代码行数:18,


示例18: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPsbLocalDatabaseMediaListViewSelection::GetSelectedMediaItems(nsISimpleEnumerator * *aSelectedMediaItems){  NS_ENSURE_ARG_POINTER(aSelectedMediaItems);  nsresult rv;    // just create an indexed enumerator and wrap it; this makes sure we reuse  // the code and the two enumerator implementations are kept in sync.  nsCOMPtr<nsISimpleEnumerator> indexedEnumerator;  rv = GetSelectedIndexedMediaItems(getter_AddRefs(indexedEnumerator));  NS_ENSURE_SUCCESS(rv, rv);    nsRefPtr<sbIndexedToUnindexedMediaItemEnumerator> unwrapper =    new sbIndexedToUnindexedMediaItemEnumerator(indexedEnumerator);  NS_ENSURE_TRUE(unwrapper, NS_ERROR_OUT_OF_MEMORY);    return CallQueryInterface(unwrapper.get(), aSelectedMediaItems);}
开发者ID:freaktechnik,项目名称:nightingale-hacking,代码行数:18,


示例19: NS_NewXBLContentSink

nsresultNS_NewXBLContentSink(nsIXMLContentSink** aResult,                     nsIDocument* aDoc,                     nsIURI* aURI,                     nsISupports* aContainer){  NS_ENSURE_ARG_POINTER(aResult);  nsXBLContentSink* it;  NS_NEWXPCOM(it, nsXBLContentSink);  NS_ENSURE_TRUE(it, NS_ERROR_OUT_OF_MEMORY);  nsCOMPtr<nsIXMLContentSink> kungFuDeathGrip = it;  nsresult rv = it->Init(aDoc, aURI, aContainer);  NS_ENSURE_SUCCESS(rv, rv);  return CallQueryInterface(it, aResult);}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:18,


示例20: nsDependentString

/*static*/ nsresultImageEncoder::GetInputStream(int32_t aWidth,                             int32_t aHeight,                             uint8_t* aImageBuffer,                             int32_t aFormat,                             imgIEncoder* aEncoder,                             const char16_t* aEncoderOptions,                             nsIInputStream** aStream){  nsresult rv =    aEncoder->InitFromData(aImageBuffer,                           aWidth * aHeight * 4, aWidth, aHeight, aWidth * 4,                           aFormat,                           nsDependentString(aEncoderOptions));  NS_ENSURE_SUCCESS(rv, rv);  return CallQueryInterface(aEncoder, aStream);}
开发者ID:Lootyhoof,项目名称:Tycho,代码行数:18,


示例21: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPsbTemporaryMediaItem::GetPropertyIDs(nsIStringEnumerator** aPropertyIDs){  // Validate arguments.  NS_ENSURE_ARG_POINTER(aPropertyIDs);  // Function variables.  nsresult rv;  // Create an empty property ID enumerator.  nsCOMPtr<nsISimpleEnumerator> propertyIDs;  rv = NS_NewEmptyEnumerator(getter_AddRefs(propertyIDs));  NS_ENSURE_SUCCESS(rv, rv);  rv = CallQueryInterface(propertyIDs, aPropertyIDs);  NS_ENSURE_SUCCESS(rv, rv);  return NS_OK;}
开发者ID:AntoineTurmel,项目名称:nightingale-hacking,代码行数:18,


示例22: GetFrame

NS_IMETHODIMP nsContainerBoxObject::GetDocShell(nsIDocShell** aResult){  *aResult = nsnull;  nsIFrame *frame = GetFrame(false);  if (frame) {    nsSubDocumentFrame *subDocFrame = do_QueryFrame(frame);    if (subDocFrame) {      // Ok, the frame for mContent is an nsSubDocumentFrame, it knows how      // to reach the docshell, so ask it...      return subDocFrame->GetDocShell(aResult);    }  }  if (!mContent) {    return NS_OK;  }    // No nsSubDocumentFrame available for mContent, try if there's a mapping  // between mContent's document to mContent's subdocument.  // XXXbz sXBL/XBL2 issue -- ownerDocument or currentDocument?  nsIDocument *doc = mContent->GetDocument();  if (!doc) {    return NS_OK;  }    nsIDocument *sub_doc = doc->GetSubDocumentFor(mContent);  if (!sub_doc) {    return NS_OK;  }  nsCOMPtr<nsISupports> container = sub_doc->GetContainer();  if (!container) {    return NS_OK;  }  return CallQueryInterface(container, aResult);}
开发者ID:lofter2011,项目名称:Icefox,代码行数:44,


示例23: NS_NEWXPCOM

/*virtual*/ nsresult sbGStreamerMediacoreFactory::OnCreate(const nsAString &aInstanceName,                                     sbIMediacore **_retval){  nsRefPtr<sbGStreamerMediacore> mediacore;  NS_NEWXPCOM(mediacore, sbGStreamerMediacore);  NS_ENSURE_TRUE(mediacore, NS_ERROR_OUT_OF_MEMORY);  nsresult rv = mediacore->Init();  NS_ENSURE_SUCCESS(rv, rv);  rv = mediacore->SetInstanceName(aInstanceName);  NS_ENSURE_SUCCESS(rv, rv);  rv = CallQueryInterface(mediacore.get(), _retval);  NS_ENSURE_SUCCESS(rv, rv);  return NS_OK;}
开发者ID:AntoineTurmel,项目名称:nightingale-hacking,代码行数:19,


示例24: CallQueryInterface

NS_IMETHODIMPnsPopupSetFrame::Init(nsPresContext*  aPresContext,                     nsIContent*      aContent,                     nsIFrame*        aParent,                     nsStyleContext*  aContext,                     nsIFrame*        aPrevInFlow){  mPresContext = aPresContext; // Don't addref it.  Our lifetime is shorter.  nsresult  rv = nsBoxFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);  nsIRootBox *rootBox;  nsresult res = CallQueryInterface(aParent->GetParent(), &rootBox);  NS_ASSERTION(NS_SUCCEEDED(res), "grandparent should be root box");  if (NS_SUCCEEDED(res)) {    rootBox->SetPopupSetFrame(this);  }  return rv;}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:19,


示例25: lock

NS_IMETHODIMPnsWindowMediator::GetZOrderXULWindowEnumerator(            const PRUnichar *aWindowType, PRBool aFrontToBack,            nsISimpleEnumerator **_retval){  if (!_retval)    return NS_ERROR_INVALID_ARG;  nsAutoLock lock(mListLock);  nsAppShellWindowEnumerator *enumerator;  if (aFrontToBack)    enumerator = new nsASXULWindowFrontToBackEnumerator(aWindowType, *this);  else    enumerator = new nsASXULWindowBackToFrontEnumerator(aWindowType, *this);  if (enumerator)    return CallQueryInterface(enumerator, _retval);  return NS_ERROR_OUT_OF_MEMORY;}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:19,


示例26: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPnsHTMLObjectElement::GetContentDocument(nsIDOMDocument **aContentDocument){  NS_ENSURE_ARG_POINTER(aContentDocument);  *aContentDocument = nsnull;  if (!IsInDoc()) {    return NS_OK;  }  // XXXbz should this use GetCurrentDoc()?  sXBL/XBL2 issue!  nsIDocument *sub_doc = GetOwnerDoc()->GetSubDocumentFor(this);  if (!sub_doc) {    return NS_OK;  }  return CallQueryInterface(sub_doc, aContentDocument);}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:19,


示例27: do_QueryInterface

already_AddRefed<nsIDOMNode>nsCoreUtils::GetDOMNodeForContainer(nsIDocShellTreeItem *aContainer){  nsCOMPtr<nsIDocShell> shell = do_QueryInterface(aContainer);  nsCOMPtr<nsIContentViewer> cv;  shell->GetContentViewer(getter_AddRefs(cv));  if (!cv)    return nsnull;  nsIDocument* doc = cv->GetDocument();  if (!doc)    return nsnull;  nsIDOMNode* node = nsnull;  CallQueryInterface(doc, &node);  return node;}
开发者ID:gorakhargosh,项目名称:mozilla-central,代码行数:19,


示例28: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPnsHTMLObjectElement::GetContentDocument(nsIDOMDocument** aContentDocument){    NS_ENSURE_ARG_POINTER(aContentDocument);    *aContentDocument = nsnull;    if (!mDocument) {        return NS_OK;    }    nsIDocument *sub_doc = mDocument->GetSubDocumentFor(this);    if (!sub_doc) {        return NS_OK;    }    return CallQueryInterface(sub_doc, aContentDocument);}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:19,


示例29: CallQueryInterface

/* static */ voidnsMathMLFrame::GetEmbellishDataFrom(nsIFrame*        aFrame,                                    nsEmbellishData& aEmbellishData){  // initialize OUT params  aEmbellishData.flags = 0;  aEmbellishData.coreFrame = nsnull;  aEmbellishData.direction = NS_STRETCH_DIRECTION_UNSUPPORTED;  aEmbellishData.leftSpace = 0;  aEmbellishData.rightSpace = 0;  if (aFrame && aFrame->IsFrameOfType(nsIFrame::eMathML)) {    nsIMathMLFrame* mathMLFrame;    CallQueryInterface(aFrame, &mathMLFrame);    if (mathMLFrame) {      mathMLFrame->GetEmbellishData(aEmbellishData);    }  }}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:19,



注:本文中的CallQueryInterface函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CallService函数代码示例
C++ CallProtoService函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。