com

FreeThreadedDOMDocument, Neutral Apartments and Free-Threaded Marshaler

不羁岁月 提交于 2019-12-11 05:42:27
问题 As MSDN states: If you are writing a single threaded application (or a multi-threaded application where only one thread accesses a DOM at one time), use the rental threaded model (Msxml2.DOMDocument.3.0 or Msxml2.DOMDocument.6.0). If you are writing an application where multiple threads access will simultaneously access a DOM, use the free threaded model (Msxml2.FreeThreadedDOMDocument.3.0 or Msxml2.FreeThreadedDOMDocument.6.0). Is there any connection between FreeThreadedDOMDocument, neutral

.NET/COM Exception with IRTDUpdateEvent

梦想的初衷 提交于 2019-12-11 05:40:04
问题 We built an RTD Server assembly which has been in wide use for several years. (It was built with VS 2008, .NET 3.5 Target Runtime.) Today a user reported getting the following Exception: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.IRTDUpdateEvent'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{A43788C1-D91B-11D3-8F39-00C04F3651B8}' failed due to

Unable to get usable data from System.__COMObject

一世执手 提交于 2019-12-11 05:28:52
问题 I am working with a third party SDK (Proprietary) which I have referenced in my console app, I been tasked to help build a solution which will facilitate many everyday tasks. However, as I been building one part of the solution I am observing that certain items return objects which to me looks like errors. This only happens with certain items, however other items return meaningful data, so I assume is related to it being null, or non existent. However I would like to ask the community for

OneNote COM Addin only loads manually

China☆狼群 提交于 2019-12-11 05:24:01
问题 I have been working on a COM add-in for OneNote based on the tutorial at http://www.malteahrens.com/#/blog/howto-onenote-dev/ and http://support.microsoft.com/kb/2555352. It builds fine, however, when I load OneNote, I have to manually go through to options to start the add in. It tells me a "runtime error occurred during the loading of the COM add-in." Once the add-in is loaded manually it works as it should. I've been searching around on the internet for a while without much luck. I have

Why CoCreateInstance returns REGDB_E_CLASSNOTREG on some Windows?

被刻印的时光 ゝ 提交于 2019-12-11 05:22:25
问题 I want to use DSound Audio Render in one of my application so I load it with CoCreateInstance. Here is a little snippet: #include <iostream> #include <strmif.h> #include <uuids.h> int main() { std::cout << "Start" << std::endl; HRESULT hr = CoInitialize(NULL); printf("CoInitialize = 0x%x\n", hr); IBaseFilter* ptr = NULL; hr = CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**)&ptr); printf("CoCreateInstance = 0x%x\n", hr); ptr->Release(); CoUninitialize(); std:

.NET implementation of C++ interface, exposing to COM

耗尽温柔 提交于 2019-12-11 05:15:02
问题 I'm sure the answer to my issue is a combination of many threads already present on this forum. Maybe you can help me put the pieces together. So my challenge is, I have some C++ code that implements an interface that looks like this: interface ItsSupplier : IDispatch { [propget, id(1), helpstring("property name") HRESULT Name([out, retval] BSTR* pVal); } The DLL which implements this interface, is a usable plugin in a third party software. I want to make a plugin written in .NET. Since the

Blocking method of an STA COM object is a design defect?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:01:11
问题 Say a COM object is created on an STA thread. So all calls to this object are serialized in this thread. So if a method of the object's is blocking, all threads that use this object are blocked. So having a blocking method in an STA COM object is a design defect to be avoided? If the COM object is free threading, it is OK to have a blocking method? Thanks 回答1: Yes, objects on single-threaded apartments are synchronized via messages and all calls to them are serialized in such way that no more

Managed Debugging Assistant 'DisconnectedContext'

你说的曾经没有我的故事 提交于 2019-12-11 04:57:53
问题 After setting up a unit test in VS2105 which created some COM objects using Unity I started getting the following error: Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\te.processhost.managed.exe'. I had a quick look to see if anyone else had the same problems and a lot of the solutions to the problem were either to fire off the test in it's own thread or change

COM pass function pointer (delegate) as a method parameter to ActiveX object (implemented in C#)

做~自己de王妃 提交于 2019-12-11 04:53:22
问题 I'm working on a browser plugin using ActiveX/COM and I'm trying to pass a Javascript function to a method call so that it can be used as a callback. I've been able to get the function assigned to a property on the ActiveX object, but since the method is async all calls to the method must share the same callback. I've seen this existing SO question but I'm not sure if this is the exact same problem since I'm not dealing directly with function pointers. Example of what we have now : var obj =

Allowing multiple versions of the same COM library

巧了我就是萌 提交于 2019-12-11 04:46:33
问题 I wrote a C# program and library that allow a user to more easily use a particular proprietary simulator's COM interface. Currently I have to build and distribute a different version of the C# library for each version of the simulator I wish to support. The company that develops the simulator regularly releases new versions, and each new version gets an incremented major version number. As far as I can tell, there is no change to the COM interface between versions (yet) so the calls and