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

		BasicCOMImplementations.h

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


		Author:	Alec
		Date:	2/25/98

		Revision History

		when		who			what & why
		==========	==========	======================================================
		02/25/99	Alec		seperated the extension DLL calls from 
									BasicCOMImplementations so it can be used in shell
		
*****************************************************************************************/

#ifndef __BASICCOMEXTIMPLEMENTATIONS__
#define __BASICCOMEXTIMPLEMENTATIONS__

#pragma once

#include "BasicCOMImplementations.h"

// Exported functions for all extensions
extern "C" MCCOMErr MCCOMAPI MCDllGetClassObject(const MCCLSID& rclsid, const MCIID& riid, void** ppv);
extern "C" MCCOMErr MCCOMAPI MCDllCanUnloadNow(void);
extern "C" MCCOMErr MCCOMAPI MCDllInit(IMCUnknown* utilities);
extern "C" MCCOMErr MCCOMAPI MCDllCleanUp();

// Extensions personal Inits - use an empty function if not used
void ExtensionInit(IMCUnknown* utilities);
void ExtensionCleanup();

TBasicUnknown* MakeCOMObject(const MCCLSID &classId); //external used in TBasicObjectFactory::CreateInstance()

/// \addtogroup BaseClass
/// \{
//******************************************************************
/// Basic Object Factory class
class TBasicObjectFactory : public TBasicUnknown, public IMCClassFactory
{
	public:
  		TBasicObjectFactory(const MCCLSID &classId);
		
 		virtual MCCOMErr MCCOMAPI QueryInterface		(const MCIID& riid, void** ppvObj);
 		virtual uint32	 MCCOMAPI AddRef 				()			{ return TBasicUnknown::AddRef(); }
		STANDARD_RELEASE;

		virtual MCCOMErr MCCOMAPI CreateInstance		(IMCUnknown* pUnkOuter, const MCIID& riid, void** ppvObject);
    	virtual MCCOMErr MCCOMAPI LockServer			(boolean fLock);
	
	protected:

		MCCLSID fClassId;
 };    

/// \}
#endif