我正试图利用一个COM。 我从一个不同的透镜中去除这一错误。 单一翻新模式也不存在同样的错误。
What could be the possible reason?
我尝试使用<代码>CComMultiThreadModel的接口。 仍无uck。
我正试图利用一个COM。 我从一个不同的透镜中去除这一错误。 单一翻新模式也不存在同样的错误。
What could be the possible reason?
我尝试使用<代码>CComMultiThreadModel的接口。 仍无uck。
您在座标上登记了代用品/泡沫物品,因此,其接口可以装上有关线。
You have two choices a) register the proxies. If the interfaces are private to your app you can merge the proxy stubs. If they are not you should create a separate DLL. The ATL wizard can help you generate proxies, so it s likely you already have them and you just didn t install/register them.
轴心将确保向您的物体发出的电话在注册的同一个COM公寓内进行。 阁下,STA。 这也减少了锁定的必要性,因为只有一条电话将放在你的法典中,。
当然,你仍然需要保护,以免重新出现,因为你的STA物体可能在外围停留期间重新加入。 。
使用轴心的倒塌方是,在装饰和等待STA时,都会产生效绩成本。
In the classic Win32 model, you should always use the STA for COM objects that encapsulate UI, because HWNDs are always tied to a single thread.
b) Aggregate the Free-threaded marshaller. You will also find an option for this in ATL. The free-threaded marshaller enables your COM objects to be directly called from any apartment in the process. http://msdn.microsoft.com/en-us/library/windows/desktop/ms694500(v=vs.85).aspx
When you use the FTM, calls on your objects are direct vtable calls - no marshalliong involved.
选择这一办法,要求你使你的代码变得接近安全(通过采用适当的锁定),因为电话现在可能同时来自多个线索。
An additional burden is that FTM objects cannot directly hold onto interface pointers unless it knows for certain that those objects also aggregate the FTM. So when you get an IUnknown from someone else, you need to store it in an appartment neutral format (such as in the Global Interface Table).
For this and other reasons, the FTM is an advanced choice for folks who know what they are doing. But it is also the highest performance option for non-UI code.
Martyn
I am trying to add a button to one of the existing tool bars in any windows explorer instance. After much research i figured out that BHO (browser helper objects) are the best way to hook to ...
I m finding leaked heap blocks by using the following command in WinDbg !heap –l With each leaked heap block I get, I m running to following to get the stack trace. !heap -p -a leakedheapblock The ...
I m new to COM. What exactly is the advantage of replacing: L"String" with CComBSTR(L"String") I can see a changelist in the COM part of my .NET application where all strings are replaced in this ...
ATL provides a bunch of macros for creating so-called COM maps - chains of rules of how the QueryInterface() call behaves on a given object. The map begins with BEGIN_COM_MAP and ends with END_COM_MAP....
I am trying to develop an IThumbnailProvider for use in Windows 7. Since this particular thumbnail would also be dependant on some other files in the same directory, I need to use something other than ...
What s the best way to get a chunk of memory (i.e. void*) from a COM server to C#? We have been using an IStream (using CreateStreamOnHGlobal) and passing that back, which worked. However when we ...
I m trying to roll my own implementation of IShellBrowser because I need to have a more full-featured File Open and Save As dialog than Windows allows that is compatible with XP (and ideally with ...
folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks