Category : com

Essential COM, Don Box Chapter 1, Abstract Bases as Binary Interfaces, Page 18 If you do not have a copy of this book, and are curious about Component Object Model (COM) scroll down to the bottom where I give some further background information. The IFastString interface class is defined as // ifaststring.h class IFastString { ..

Read more

I’m a COM newbie trying to make a dirt-simple C++ console app to test consuming a COM DLL. In my lone .cpp file, I include the line #import "AgLeaderFile.dll" to import the COM DLL of interest. I added the DLL’s directory to "Executable Directories" in Project Properties->Configuration Properties->VC++ Directories. I know it is being found, ..

Read more

I have a C# .NET desktop application which uses COM-objects (native C++). In some conditions the app crashes with access violation exception on the following thread: ntdll!TppIteWakeWaiters+0xa ntdll!TppCallbackEpilog+0xfc ntdll!TppWorkerThread+0x4ad kernel32!BaseThreadInitThunk+0x14 ntdll!RtlUserThreadStart+0x21 Of course, I want to debug that. But the question is, what high-level C#/C++ code stand behind this call? I assume, there is something ..

Read more

I’m trying to rewrite some code that calls a local COM Server from C# to C++. The C# code works without issue. The key part is: Guid lr_FactoryGuid = Guid.Parse("AE7CFA4B-985A-4F76-8CC6-2011649FC8A9"); Guid lr_FactoryClass = Guid.Parse("1CA0D073-4ABB-4D06-B318-BFFDE38E4903"); IntPtr lk_FactoryPtr = new IntPtr(); CoGetClassObject( ref lr_FactoryClass, 4, new IntPtr(), ref lr_FactoryGuid, out lk_FactoryPtr); if (lk_FactoryPtr == IntPtr.Zero) { MessageBox.Show("lk_FactoryPtr ..

Read more

I’ve created a COM class within an exe server. It’s designed to be a singleton. It basically gets instantiated once, and then it keeps tabs on various events occurring on the machine. Also, other COM classes, which are loaded via DLL into another process, communicate with it every now and then. I’ve read that DECLARE_CLASSFACTORY_SINGLETON/CComClassFactorySingleton ..

Read more

Does anyone know the complete, proper control flow between the above-referenced interfaces? Obviously when an input object obtains focus, it calls IInputObjectSite::OnFocusChangeIS to let the site know. And then when messages come through, the site calls IInputObject::TranslateAcceleratorIO to let the input object handle messages before dispatch. But there are a couple more methods, and I’m ..

Read more