// -----------------------------------------------------------------------------
//
// FILE:	Plugin.cpp
// ----		
//			Fichier de configuration du plugin de l'exporter Max -> M3d
//
// Author:	Olivier Lamotte
// ------	Copyright(c) Cryo-Networks
//
// Histo:	- Version 0
// -----		Début: 27 / 11 / 2000
//
// -----------------------------------------------------------------------------
//
// Methods:	
//	- DllMain
//	- LibDescription
//	- LibNumberClasses
//	- LibClassDesc
//	- LibVersion
//	- GetString
//	- GetExportSelected
//	- SetExportSelecled
//
// -----------------------------------------------------------------------------
//
#include "Export.h"



HINSTANCE hInstance;
int controlsInit = FALSE;


// =============================================================================
// DllMain
// -----------------------------------------------------------------------------
BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) 
{
	hInstance = hinstDLL;

	if ( !controlsInit ) 
	{
		controlsInit = TRUE;
		
		InitCustomControls(hInstance);
		InitCommonControls();
	}

	return(TRUE);
}
// =============================================================================


// =============================================================================
// LibDescription
// -----------------------------------------------------------------------------
__declspec( dllexport ) const TCHAR * LibDescription() 
{ 
	return GetString(IDS_LIBDESCRIPTION); 
}
// =============================================================================


// =============================================================================
// LibNumberClasses
// -----------------------------------------------------------------------------
__declspec( dllexport ) int LibNumberClasses() 
{
	return 1;
}
// =============================================================================


// =============================================================================
// LibClassDesc
// -----------------------------------------------------------------------------
__declspec( dllexport ) ClassDesc* LibClassDesc(int i) 
{
	switch(i) 
	{
		case 0: return GetExportToM3dDesc();
		default: return 0;
	}
}
// =============================================================================


// =============================================================================
// LibVersion
// -----------------------------------------------------------------------------
__declspec( dllexport ) ULONG LibVersion() 
{ 
	return VERSION_3DSMAX; 
}
// =============================================================================


// =============================================================================
// GetString
// -----------------------------------------------------------------------------
TCHAR * GetString(int id) 
{

	static TCHAR buf[256];

	if (hInstance)
		return LoadString(hInstance, id, buf, sizeof(buf)) ? buf : NULL;
	return NULL;
}
// =============================================================================

// =============================================================================
// GetExportSelected
// -----------------------------------------------------------------------------
bool GetExportSelected()
{
	return blExportSelected;
}
// -----------------------------------------------------------------------------
// SetExportSelected
// -----------------------------------------------------------------------------
void SetExportSelected(bool value)
{
	blExportSelected = value;
}
// =============================================================================