//
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 124 posts for limbioliong

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

How C# Extension Methods Work

1. Introduction. 1.1 Extension methods were introduced in C# 3.0. 1.2 The main purpose of extension methods is to provide for seamless integration of new functionalities to existing classes. 1.3 I have personally used extension methods to great effect in my projects and I intend to share some of my extension methods with readers in … Continue reading

Passing a Reference to a SAFEARRAY as Parameter to a Managed COM Event Handler Part 3.

1. Introduction. 1.1 This blog is the third segment of the series of articles that discusses the problems and workarounds in relation to passing a reference to a SAFEARRAY as parameter to a dispinterface-based event which is fired from an unmanaged COM server to a managed client. 1.2 In part 2, I presented a workaround … Continue reading

Passing a Reference to a SAFEARRAY as Parameter to a Managed COM Event Handler Part 2.

1. Introduction. 1.1 This article is a follow up to my earlier blog which outlined the problems with passing a reference to a SAFEARRAY as parameter to a dispinterface-based event which is fired from an unmanaged COM server to a managed client. 1.2 Through this article and the next one to follow, I will demonstrate … Continue reading

Passing a Reference to a SAFEARRAY as Parameter to a Managed COM Event Handler Part 1.

1. Introduction 1.1 I recently ran into an unexpected problem with the .NET CLR. 1.2 It appears that its internal internal mechanism for processing COM events inadequately handles reference SAFEARRAYs passed as event parameters. 1.3 In this blog, I will demonstrate the problem with sample codes. It is my hope that interested readers will research … Continue reading

Using the WebBrowser Control to Print Documents

1. Introduction 1.1 Recently, a junior colleague approached me for some advise. 1.2 As part of his project work, he had need to programmatically perform printing using C#. 1.3 The document he was assigned to print includes a combination of text and images. 1.4 He had no prior experience in this task and was daunted … Continue reading

Using the TypeLibConverter to Customize Type Library Creation from an Assembly Part 2.

1. Introduction. 1.1 This article is a follow up from part 1. 1.2 In part 1, we presented C# code for a class library named CSTestInterfaceClass.dll in which an interface “ITestInterface” and a coclass “TestClass” is defined. 1.3 ITestInterface contains a single property “MyObject” of type object. Being of type object (a reference type) means … Continue reading