IClassFactroy :: CreateInstance()给出了pUnkOuter Not null值 [英] IClassFactroy::CreateInstance() gives pUnkOuter Not null value

查看:82
本文介绍了IClassFactroy :: CreateInstance()给出了pUnkOuter Not null值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的示例是C#。它提供了 pUnkOuter参数,有时不为空。我认为它基于CoCreateInstance()调用。但在下面的情况下,它来自Urlmon.dll。那么我怎么能避免它?或者如果是预期的那样,哪个是正确的方法。即如果我得到pUnkOuter不为null我应该返回什么应该是ppvObject的值。

Below sample is C#. It gives pUnkOuter parameter not null some time. I think it is based on CoCreateInstance() call. But in below case, it is coming from Urlmon.dll. So how can i avoid it? Or which is the correct way if it is expected one. I.e if i get pUnkOuter not null what should i return and what should be the value of ppvObject.

https://github.com/mganss/AsyncPluggableProtocol < span style ="font-size:14px">

https://github.com/mganss/AsyncPluggableProtocol

谢谢,Renjith VR

Thanks, Renjith V R

推荐答案

4月30日上午12:07,Renjith V Ramachandran写道:

On 4/30/2017 12:07 AM, Renjith V Ramachandran wrote:


样本是C#。它使pUnkOuter参数在某段时间内不为空。我认为它基于CoCreateInstance()调用。但在下面的情况下,它来自Urlmon.dll。那我怎么能避免呢?或者如果是预期的那样,哪个是正确的方法。即如果我得到pUnkOuter
不为null我应该返回什么应该是ppvObject的值。

Below sample is C#. It gives pUnkOuter parameter not null some time. I think it is based on CoCreateInstance() call. But in below case, it is coming from Urlmon.dll. So how can i avoid it? Or which is the correct way if it is expected one. I.e if i get pUnkOuter not null what should i return and what should be the value of ppvObject.

您正在查看COM聚合:
https://www.codeproject.com/Articles/5337 / COM-Concept-Unleashing-Aggregation

You are looking at COM aggregation: https://www.codeproject.com/Articles/5337/COM-Concept-Unleashing-Aggregation


这篇关于IClassFactroy :: CreateInstance()给出了pUnkOuter Not null值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆