Year: 2013

IErrorInfo is an OLE DB interface. It is defined in automation and returns the error message, component name and GUID of the interface where the error occurred. The link http://msdn.microsoft.com/en-us/library/windows/desktop/ms723041(v=vs.85).aspx describes its use, when to call and the methods on this interface. You might sometimes face an issue where an IErrorInfo object gets cleared on a…

Issue: Cannot register a COM DLL using ATL::CComModule::RegisterServer() If you are using a COM DLL or building one that uses ATL’s CComModule::RegisterServer() and building the code in Visual Studio 2013, you are mostly failing to register it. Say if you are using RegSvr32.exe to register your DLL, the call stack might show you the following…

I got to debug a COM threading issue where we see that when we are communicating between an application (say an MFC application) and a class library (developed using C# and implementing a COM component) the messages between the C++ thread and the C# thread are not being marshaled. The thread that actually makes the…

If you have set up certificate services or CA then you can create such a PKCS request and send it to the certificate server for signing. Here are the steps. Step 1: Go to your certificate store; right click certificates -> All Tasks -> Advanced Operations -> Create Custom Request. This is shown in…

Communication state defines the states in which a communication-oriented object can exist. These states are defined as enumerations in the System.ServiceModel.dll. http://msdn.microsoft.com/en-us/library/system.servicemodel.communicationstate(v=vs.110).aspx defines the various names in the enumeration however we do not get to see the enumeration values. As the above link explains there are four main states that a communication-oriented object can…

A _bstr_t object encapsulates the BSTR data type. The class manages resource allocation and de-allocation through function calls to SysAllocString and SysFreeString. It isn’t necessary to de-allocate or free a string by calling SysFreeString that has been allocated by _bstr_t. Doing this might lead to double free of the allocated string when the _bstr_t class…

Imagine you have a scenario wherein you want your COM Server to be called within JavaScript which invokes an Async method. Upon completion of the Async method you would like to notify the JS using callback function that the task has been completed. Doing the Async work is simple but the callback to notify the…

Scenario: Client application invokes a Duplex WCF service, and WCF service can invoke multiple callbacks at a time. Problem: You notice that the callback operations are executed sequentially even though they are marked as one way operations. Cause: Callback operations are handled on a separate worker thread at client application. By default, the concurrency mode…

WCF: Observing Message ProtectionOrder Objective 1: Impact of Protection Order Objective 2: How to observe/confirm that my request is signed and encrypted from WCF traces. Objective 3: Utilize the knowledge of reading WCF traces and apply the same for troubleshooting the INTEROPE scenarios. Understanding: http://msdn.microsoft.com/en-us/library/system.servicemodel.security.messageprotectionorder.aspx Scope: Via Protection…