//
archives

Lim Bio Liong

I've been in software development for nearly 20 years specializing in C , COM and C#. It's truly an exicting time we live in, with so much resources at our disposal to gain and share knowledge. I hope my blog will serve a small part in this global knowledge sharing network. For many years now I've been deeply involved with C development work. However since circa 2010, my current work has required me to use more and more on C# with a particular focus on COM interop. I've also written several articles for CodeProject. However, in recent years I've concentrated my time more on helping others in the MSDN forums. Please feel free to leave a comment whenever you have any constructive criticism over any of my blog posts.
Lim Bio Liong has written 130 posts for limbioliong

Understanding Windows Structured Exception Handling Part 4 – Pseudo __try/__except

Introduction 1. In previous parts of this series of articles, we did a lot of meticulous study of Win32 Structured Exception Handling. 2. Here in part 4, I present a sample code that demonstrates how we can not only construct a custom SEH Frame but also our own pseudo __except filter function and __except block. … Continue reading

Understanding Windows Structured Exception Handling Part 3 – Under The Hood

Introduction 1. In parts 1 and 2, we have studied how SEH is constructed in a function by the Visual C++ compiler. We have also seen how __try/__except/__finally blocks are tracked and their means of execution made possible via a SCOPETABLE_ENTRY array. 2. In this part 3 of this multi-part series of articles on Win32 … Continue reading

Understanding Windows Structured Exception Handling Part 2 – Digging Deeper

Introduction 1. In part 1 of this series of articles, we touched on the basics of Windows Structured Exception Handling (SEH) in Win32. 2. We learned how to manually setup a SEH Frame in C/C++ without the use of the __try/__except block. 3. We also saw how SEH can be used to fix errors that … Continue reading

Understanding Windows Structured Exception Handling Part 1 – The Basics

Introduction 1. Just what is meant by an exception ? The following definition from MSDN explains it well : “An exception is an event that occurs during the execution of a program, and requires the execution of code outside the normal flow of control. There are two kinds of exceptions: hardware exceptions and software exceptions. … Continue reading

A Use Case for ICustomQueryInterface

1. Introduction 1.1 Recently, I came across a question posted on the Microsoft Q&A site (see COM interop – pass a char[] array) in which the OP expressed a situation in which an unmanaged C++ program had tried but failed to call a C# method that takes a char array parameter. The following is a … Continue reading

An Unmanaged Implementation of the IList Interface Part 1

1. Introduction 1.1 In this multi-part post, I will present an implementation of the .Net IList interface using unmanaged code. 1.2 Specifically, I shall be coding in C++ using ATL. 1.3 In this part 1, I will show how to use several STL classes and techniques to provide the functionality of IList. 1.4 Another important … Continue reading

Understanding Implementations for ITypeLibExporterNotifySink Part 1.

1. Introduction. 1.1 This article is a follow up to my last blog Programmatically Register Assemblies in C#. 1.2 In that article, I mentioned that I will be writing more to explain implementations for the ITypeLibExporterNotifySink interface as used in the context of a call to TypeLibConverter.ConvertAssemblyToTypeLib(). 1.3 I will dive straight into exploring this … Continue reading

Programmatically Register Assemblies in C#.

1. Introduction. 1.1 After publishing Programmatically Register COM Dlls in C# back in 2011, I received a number of requests for advise on how to register managed assemblies as COM servers. 1.2 In this blog, I will present the reader with a sample C# program that will perform such registration. 1.3 The sample assembly COM-registration … Continue reading

Replace all UUIDs in an ATL COM DLL.

1. Introduction. 1.1 Recently, a friend asked me for advise on a very unusual requirement. 1.2 He needs to replace all UUIDs in a COM DLL with new ones. 1.3 He does not have the source codes to the original COM server so any modifications will have to be done on the binary code. 1.4 … Continue reading

Explore Possibilities with MSIL.

1. Introduction. 1.1. It will be hard to find an intermediate and advanced .NET programmer who has not heard of MSIL. 1.2 I have occasionally worked with IL code in the past, specifically when there is a need to modify the declarations of parameters and attributes for the purpose of interop marshaling. 1.3 Then last … Continue reading