Click here to Skip to main content
15,893,588 members
Articles / Programming Languages / C++

System Information Utility

Rate me:
Please Sign up or sign in to vote.
4.95/5 (12 votes)
17 Apr 2001 502.1K   8.6K   107  
Utility to extract system information
// SystemCPU.idl : IDL source for SystemCPU.dll
//

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

import "oaidl.idl";
import "ocidl.idl";
	[
		object,
		uuid(B2EB919C-C48E-11D2-8C6A-000000000000),
		dual,
		helpstring("ICPUInformation Interface"),
		pointer_default(unique)
	]
	interface ICPUInformation : IDispatch
	{
		[propget, id(1), helpstring("property NumberOfProcessors")] HRESULT NumberOfProcessors([out, retval] long *pVal);
		[propget, id(2), helpstring("property CPUSpeed")] HRESULT CPUSpeed([out, retval] long *pVal);
		[propget, id(3), helpstring("property PageSize")] HRESULT PageSize([out, retval] long *pVal);
		[propget, id(4), helpstring("property ActiveProcessorMask")] HRESULT ActiveProcessorMask([out, retval] long *pVal);
		[propget, id(5), helpstring("property Vendor")] HRESULT Vendor([out, retval] BSTR *pVal);
		[propget, id(6), helpstring("property ProcessorType")] HRESULT ProcessorType([out, retval] BSTR *pVal);
		[propget, id(7), helpstring("property Architecture")] HRESULT Architecture([out, retval] BSTR *pVal);
		[propget, id(8), helpstring("property CPULevel")] HRESULT CPULevel([out, retval] BSTR *pVal);
		[propget, id(9), helpstring("property CPURevision")] HRESULT CPURevision([out, retval] BSTR *pVal);
		[id(10), helpstring("method GetCPUInformation")] HRESULT GetCPUInformation(BSTR *pbstrVendor, BSTR *pbstrType, BSTR *pbstrArchitecture, BSTR *pbstrLevel, BSTR *pbstrRevision, long *plNumberOfProcessors, long *plSpeed, long *plPageSize, long *plMask);
	};

[
	uuid(B2EB9190-C48E-11D2-8C6A-000000000000),
	version(1.0),
	helpstring("SystemCPU 1.0 Type Library")
]
library SYSTEMCPULib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(B2EB919E-C48E-11D2-8C6A-000000000000),
		helpstring("CPUInformation Class")
	]
	coclass CPUInformation
	{
		[default] interface ICPUInformation;
	};
};

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions