Click here to Skip to main content
15,884,473 members
Articles / Desktop Programming / MFC

How to use Dynamic External MFC CView Class Objects (which exists in a DLL library) in a VBA Host MFC Application

Rate me:
Please Sign up or sign in to vote.
1.00/5 (10 votes)
8 Dec 20023 min read 57.2K   389   11  
Implement interface between two existing DLL Library in a VBA Host MFC application.
// TangramDllRight.idl : IDL source for TangramDllRight
//

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

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

[
	object,
	uuid(D1CABACA-C60C-4624-A7E7-19C7DEE6E27B),
	dual,
	nonextensible,
	helpstring("ICnn Interface"),
	pointer_default(unique)
]
interface ICnn : IDispatch{
		[id(1), helpstring("method Connect"), hidden] HRESULT Connect([in]long pConnectManager);
};
[
	object,
	uuid(21B6ECA5-22C7-4D71-8108-393EC4809296),
	dual,
	nonextensible,
	helpstring("IAtlRight �ӿ�"),
	pointer_default(unique)
]
interface IAtlRight : IDispatch{
		[propget, id(1), helpstring("property Name")] HRESULT Name([out, retval] BSTR *pVal);
		[propput, id(1), helpstring("property Name")] HRESULT Name([in] BSTR newVal);
		[id(2), helpstring("method AddText")] HRESULT AddText(BSTR strText);
};
[
	uuid(2353F724-744B-4881-BC0A-F27A9DC38A34),
	version(1.0),
	helpstring("TangramDllRight 1.0 Type Library")
]
library TangramDllRightLib
{
	importlib("stdole2.tlb");
	[
		uuid(7E8C85AF-4DE1-4172-8DE7-29B7CEF858FA),
		helpstring("Cnn Class")
	]
	coclass Cnn
	{
		[default] interface ICnn;
	};
	[
		uuid(9DC8B2F3-6BBD-4691-9E1D-C8ED9953AA6E),
		helpstring("_IAtlRightEvents Interface")
	]
	dispinterface _IAtlRightEvents
	{
		properties:
		methods:
	};
	[
		uuid(7A947C74-4C53-4461-A93D-CBAEEA355AEA),
		helpstring("AtlRight Class")
	]
	coclass AtlRight
	{
		[default] interface IAtlRight;
		[default, source] dispinterface _IAtlRightEvents;
	};
};

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
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions