/****************************************************************************************************

		IComDll.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Arnaud
		Date:	3/18/2005

****************************************************************************************************/

#ifndef __IComDll__
#define __IComDll__

#if CP_PRAGMA_ONCE
#pragma once
#endif



#include "MCCompObj.h"


MCDEFINE_GUID_H(IID_IComDll);


/// \addtogroup BasicCOM
/// \{

/// Interface for a com dll. 
/// It should be created with gShSafeUtilities, then loaded and asked to create an object
struct IComDll: public IMCUnknown
{
//NOTE: do NOT add unsafe objects to the interface (like resource files)
public:
	///Loads and initializes the dll
	virtual void		MCCOMAPI LoadDLL			() = 0;

	///Cleans up and unloads the dll
	virtual void		MCCOMAPI UnloadDLL			() = 0;


	// ****************************************************************************
	//								CoCreateInstance
	// 
	/// Manually creates a component from the dll.
	/// \param rclsid        Class ID of the component to create
	/// \param pUnkOuter     Pointer to the controlling Unknown object (Used for COM aggregation). You can pass null
	/// \param riid          Interface ID for the interface we want (can be the same than rclsid)
	/// \param ppv           Points to the resulting interface of the component created
	/// 
	virtual void		MCCOMAPI CoCreateInstance		(	const MCCLSID&		rclsid, 
															IMCUnknown*			pUnkOuter, 
															const MCIID&		riid, 
															void**				ppv) = 0;
	
};




/// \}













#endif
