If you have done any modern GUI development on .NET, then you are probably familiar with the INotifyPropertyChanged interface and the joys of implementing that interface.
Continue »
Google APIs use OAuth 2.0 for authentication and authorization. To call an API, you first have to obtain an access token for the right scope and then pass it to the respective API by using the Authorization HTTP header.
But the trouble with access tokens is that they are short-lived, and you somehow have to deal with expiring tokens…
Continue »
Avoiding COM object leaks in managed applications that make use of COM Interop can be a daunting task. While diligent tracking of COM object references and appropriate usage of Marshal.ReleaseComObject usually works fine, COM Interop is always good for surprises.
Recently having been tracking down a COM object leak in a COM/.Net-Interop-centric application, I noticed that the CLR did not quite manage the reference count on my COM object as I expected it to do – more precisely, it incremented the referece count of a COM object when it was passed (from COM) as a method parameter to a callback implemented in .
Continue »
TlbImp, the .Net tool to create Interop assemblies from COM type libraries, contains an optimization that presumably aims at making the consumption of the Interop assembly easier, but ultimately is a nuisance. Consider the following IDL code:
import "oaidl.idl"; import "ocidl.idl"; [ uuid( a657ef35-fea1-40ad-86d8-bb7b6085a0a3 ), version( 1.0 ) ] library Test { [ object, uuid( 84b2f017-b8fe-4c2c-87b8-0587b4bf5507 ), version( 1.0 ), oleautomation ] interface IFoo : IUnknown { HRESULT Foo(); } [ object, uuid( 13d950d6-beb3-4dd3-957b-88b0e5eb5e3f ), version( 1.
Continue »