Click here to Skip to main content
15,890,579 members

Lim Bio Liong - Professional Profile



Summary

    Blog RSS
64,911
Author
1,663
Authority
588
Debator
112
Organiser
1,019
Participant
0
Editor
0
Enquirer
Lim Bio Liong is a Specialist at a leading Software House in Singapore.

Bio has been in software development for over 10 years. He specialises in C/C++ programming and Windows software development.

Bio has also done device-driver development and enjoys low-level programming. Bio has recently picked up C# programming and has been researching in this area.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralRe: Question about IRpcChannelBuffer From MSDN COM Newsgroup Pin
Lim Bio Liong10-Nov-05 17:35
Lim Bio Liong10-Nov-05 17:35 
GeneralAbout Reference Counting Pin
Lim Bio Liong10-Nov-05 17:21
Lim Bio Liong10-Nov-05 17:21 
GeneralRe: About Reference Counting Pin
Lim Bio Liong10-Nov-05 17:22
Lim Bio Liong10-Nov-05 17:22 
GeneralHow to: Determine If a File Is an Assembly (C# Programming Guide) Pin
Lim Bio Liong27-Oct-05 4:44
Lim Bio Liong27-Oct-05 4:44 
GeneralATL Attributes (a.k.a. Embedded IDL). Pin
Lim Bio Liong21-Oct-05 22:19
Lim Bio Liong21-Oct-05 22:19 
GeneralBasic COM/.NET Interop Techniques Pin
Lim Bio Liong12-Oct-05 1:54
Lim Bio Liong12-Oct-05 1:54 
GeneralRe: Basic COM/.NET Interop Techniques Pin
Lim Bio Liong12-Oct-05 14:03
Lim Bio Liong12-Oct-05 14:03 
GeneralRe: Basic COM/.NET Interop Techniques Pin
Lim Bio Liong18-Oct-05 5:50
Lim Bio Liong18-Oct-05 5:50 
A Simple COM Object Interface

We begin our code development by defining a simple COM interface named ISimpleCOMObject. Using Visual Studio .NET, we create an ATL project named SimpleCOMObject.sln (complete source codes for this project is included in the downloadable sample codes).

This SimpleCOMObject.sln project will not contain any useful implementation codes. Its purpose is simply to allow us to automate the creation and maintenance of the ISimpleCOMObject interface. This is accomplished via the use of the ATL Wizards.

The project file folder also serves as the central point for the storage and generation of various .NET related resources (e.g. Primary Interop Assembly, Strong Name Key Files, etc). More on these later.

Listed below is a fragment of code taken from SimpleCOMObject.idl showing the ISimpleCOMObject interface :

[
object,
uuid(9EB07DC7-6807-4104-95FE-AD7672A87BD7),
dual,
nonextensible,
helpstring("ISimpleCOMObject Interface"),
pointer_default(unique)
]
interface ISimpleCOMObject : IDispatch{
[propget, id(1), helpstring("property LongProperty")] HRESULT LongProperty([out, retval] LONG* pVal);
[propput, id(1), helpstring("property LongProperty")] HRESULT LongProperty([in] LONG newVal);
[id(2), helpstring("method Method01")] HRESULT Method01([in] BSTR strMessage);
};

ISimpleCOMObject contains one property (LongProperty) and one method (Method01()). We stipulate that ISimpleCOMObject is meant to be implemented by an object that takes a long value (LongProperty) and then displays its value when we call Method01(). The BSTR parameter "strMessage" is meant to be a short message which is to be displayed with the LongProperty value when Method01() is called.

We defined ISimpleCOMObject as a dual interface. Hence a client application can call its methods by using a vtable interface pointer or by using an IDispatch interface pointer. Although it is possible to define ISimpleCOMObject as deriving from IUnknown, I have chosen to derive it from IDispatch in order to ensure that parameters and return values for its methods be strictly automation-compatible (i.e. the types that can be stored in a VARIANT structure). This is done to keep things simple.

I will assume that the reader is already well-versed in the implementation of a COM interface using an unmanaged language like C++. It is the implementation in a .NET language like C# that I intend to explain in detail in this article. The use of automation-compatible types will help to keep this process as simple as possible.

Although SimpleCOMObject.sln contains no useful implementation for ISimpleCOMObject, we will nevertheless need to compile it. Once this project is compiled successfully, two important files will be produced :

1. A Type Library (SimpleCOMObject.tlb).

2. A DLL (SimpleCOMObject.dll).

These will be created in the Debug directory of the project's containing folder. If you have downloaded my sample codes, and have not modified anything so far, these files will be stored in the following path :

<main folder>\SimpleCOMObject\interfaces\SimpleCOMObject\Debug

where is wherever you have copied the source codes zip file to.

The SimpleCOMObject.tlb will be used to produce something known as a Primary Interop Assembly. More on this in the next section.

The SimpleCOMObject.dll itself will contain the SimpleCOMObject.tlb (embedded as a binary resource). It is important as it will be registered (by the Visual Studio .NET IDE) as the Type Library for the coclasses and interfaces defined in SimpleCOMObject.idl.

This Type Library registration is done so that COM will know where to look for type information when it needs to perform marshalling for the interfaces defined in SimpleCOMObject.idl. This process is also known as Type Library Marshaling.


-- modified at 19:55 Tuesday 18th October, 2005
GeneralRe: Basic COM/.NET Interop Techniques Pin
Lim Bio Liong18-Oct-05 7:01
Lim Bio Liong18-Oct-05 7:01 
GeneralSome Interesting Information About Struct Alignment Pin
Lim Bio Liong28-Sep-05 2:50
Lim Bio Liong28-Sep-05 2:50 
GeneralIDispatch Property Setting Pin
Lim Bio Liong9-Aug-05 2:56
Lim Bio Liong9-Aug-05 2:56 
GeneralRe: IDispatch Property Setting Pin
Lim Bio Liong9-Aug-05 3:01
Lim Bio Liong9-Aug-05 3:01 
Generalhow to make MIDL not mangle enum names Pin
Lim Bio Liong8-Aug-05 3:48
Lim Bio Liong8-Aug-05 3:48 
GeneralInterface Shims Pin
Lim Bio Liong17-Jul-05 20:50
Lim Bio Liong17-Jul-05 20:50 
GeneralRe: Interface Shims Pin
Lim Bio Liong17-Jul-05 20:54
Lim Bio Liong17-Jul-05 20:54 
GeneralRe: Interface Shims Pin
Lim Bio Liong17-Jul-05 20:55
Lim Bio Liong17-Jul-05 20:55 
GeneralRe: Interface Shims Pin
Lim Bio Liong17-Jul-05 20:56
Lim Bio Liong17-Jul-05 20:56 
GeneralTake Note when adding a new ATL ActiveX Property Into the Property Map Pin
Lim Bio Liong15-Jul-05 20:28
Lim Bio Liong15-Jul-05 20:28 
GeneralUsing CComVariant and VarCmp Pin
Lim Bio Liong16-Apr-05 0:16
Lim Bio Liong16-Apr-05 0:16 
GeneralProperly Transferring Memory Objects In Method Calls. Pin
Lim Bio Liong7-Mar-05 2:00
Lim Bio Liong7-Mar-05 2:00 
GeneralInstantiating Member Data Which Are References Pin
Lim Bio Liong22-Feb-05 16:52
Lim Bio Liong22-Feb-05 16:52 
GeneralRegistry Location of Services and Device Drivers Pin
Lim Bio Liong31-Jan-05 20:07
Lim Bio Liong31-Jan-05 20:07 
GeneralNew Year @ CodeProject Pin
Lim Bio Liong31-Dec-04 17:05
Lim Bio Liong31-Dec-04 17:05 
GeneralRe: New Year @ CodeProject Pin
ThatsAlok1-Jan-06 23:42
ThatsAlok1-Jan-06 23:42 
GeneralAn Interesting Question From Microsoft's COM Newsgroup Pin
Lim Bio Liong30-Dec-04 22:17
Lim Bio Liong30-Dec-04 22:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.