其实很简单,就是再写一个dll,实际的操作都在这个dll里面,每一次导出动作都将实时的加载这个dll,导出完毕再卸载这个dll文件,这样就不用每次都重启3dsmax而可以实时的更新了.
简单的例子:
extern "C"
{
int Exporter( void );
typedef int(*CallBackExporter)( const TCHAR *name, ExpInterface *ei, Interface *i,
BOOL suppressPrompts, DWORD options );
}
//+-------------&-------------
//+---------------------------&------------------- ------
int IGameExporter::DoExport( const TCHAR *name, ExpInterface *ei, Interface *i, BOOL suppressPrompts, DWORD options )
{
HMODULE hModule;
hModule = ::LoadLibraryEx( "plugins/BMLExporter.dll", NULL, 0 );
if( hModule == NULL )
{
hModule = ::LoadLibraryEx( "BMLExporter.dll", NULL, 0 );
if( hModule == NULL )
{
MessageBox( NULL, "加载模块BMLExporter.dll失败.", "", 0 );
return 0;
}
}
CallBackExporter pfnExporter = NULL;
pfnExporter = (CallBackExporter)GetProcAddress( hModule, "Exporter" );
if( pfnExporter == NULL )
return FALSE;
int nRet = pfnExporter( name, ei, i, suppressPrompts, options );
::FreeLibrary( hModule );
return nRet;
}