Click here to Skip to main content
15,891,316 members
Articles / Programming Languages / C++

Convert Microsoft COM to XPCOM

Rate me:
Please Sign up or sign in to vote.
4.84/5 (15 votes)
26 Jul 2010CPOL4 min read 41.5K   456   32  
Step by step XPCOM creation from Microsoft COM
// Sample_mscom.idl : IDL source for Sample_mscom
//

// This file will be processed by the MIDL tool to
// produce the type library (Sample_mscom.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

[
	object,
	uuid(668C357B-5FB9-4743-8FE8-591B40ECE9A2),
	dual,
	nonextensible,
	helpstring("ISampleAdd Interface"),
	pointer_default(unique)
]
interface ISampleAdd : IDispatch{
	[id(1), helpstring("method Add")] HRESULT Add([in] LONG FisrtNumber, [in] LONG SecondNumber, [out,retval] LONG* ResultValue);
};
[
	uuid(83709A99-E59B-4A9A-8714-7C27FD3FFDFB),
	version(1.0),
	helpstring("Sample_mscom 1.0 Type Library")
]
library Sample_mscomLib
{
	importlib("stdole2.tlb");
	[
		uuid(3B0F2BED-F4D5-4AA2-9534-0EB14C66CCB1),
		helpstring("SampleAdd Class")
	]
	coclass SampleAdd
	{
		[default] interface ISampleAdd;
	};
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Eyeball Networks Inc, Dhaka
Bangladesh Bangladesh
I strongly believe, a person's strongest point is to know his/her weak point. I try to be simple.

I have completed BSc in Computer Science & Engineering from Shah Jalal University of Science & Technology, Sylhet, Bangladesh (SUST).


Watch out for my other CodeProject Articles.

Comments and Discussions