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

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

		Author:	Arnaud
		Date:	4/15/2003

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

#ifndef __MiscComUtilsImpl__
#define __MiscComUtilsImpl__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "COMSafeUtilities.h"
#include "IShUtilities.h"



//Use this to setup the resource file of a given component before loading parts or strings
//The destructor will take care of restoring the previous resource file
class CWhileInCompResFile : public TMCObject
{
public:
	CWhileInCompResFile(IDType inCompFamilyID, IDType inCompClassID)
	{
		fOldResources= NULL;
		gResourceUtilities->SetupComponentResources(inCompFamilyID, inCompClassID, &fOldResources);
	}
	~CWhileInCompResFile()
	{
		gResourceUtilities->RestoreComponentResources(fOldResources);
	}
protected:
	void* fOldResources;
};







#endif
