Type libraries, of course, were designed to agnostic the platform in most cases. Most of the ones you encountered when programming Windows that were shipped by Microsoft. Most notable in .NET, which makes it very easy to write code that can work in either 32-bit or 64-bit mode displayed by the target of the AnyCPU platform. Nothing special is required to use the interop classes in Microsoft.Office.Interop or to write extensions that run inside the Office program; you use the same type libraries.
But this does not always work so well when you use a type library created by a programmer who never believed that it works with 64-bit code. The most typical problem is caused by method arguments, which are actually pointers under the hood but flattened to a holistic type, which is a typical choice. These pointer values are 64-bit wide in 64-bit mode and do not work correctly when trying to write them to a 32-bit integer. HANDLE values are a good example.
Unfortunately, the most notorious issues are Microsoft. The type library for ADO was broken, a database vendor library that was widely used to work with dbase engines. They took a break in Windows 7 SP1, which caused widespread misfortune when programmers created their programs on this operating system and found out that they no longer work on older versions of Windows. It was different, a type that was supposed to be 32-bit on 64-bit operating systems, but was declared 64-bit on a 64-bit OS. You can see this if you have the Windows SDK version 8 header file, adoint_Backcompat.h, type ADO_LONGPTR. Replaced by long in adoint.h.
It is best to work with the original programmer to figure it out. Or, to take advantage of COM surrogates, they can run 32-bit code outside the process when called from a 64-bit process.
source share