|
|
I crreate two MFC DLL projects for 3ds max plugin.
Frist project is called maxCameraPathMFC ,which call the fDoExport function of maxCameraPathExporterMFC (second project).
[source lang="cpp"]
int maxCameraPathMFC: oExport(const TCHAR* name,ExpInterface* ei,Interface* i, BOOL suppressPrompts, DWORD options)
{
// This is where the file export operation occur.
typedef int (CALLBACK* D_MYEXPORT)(const TCHAR*,ExpInterface*,Interface*,BOOL,DWORD);
HMODULE l_mod;
D_MYEXPORT l_export=NULL;
int l_ret=0;
l_mod=LoadLibrary("plugins_akira\\2\\maxCameraPathExporterMFC.dle");
if (l_mod!=NULL)
{
l_export=(D_MYEXPORT)GetProcAddress(l_mod,"fDoExport");
l_ret=l_export(name,ei,i,suppressPrompts,options);
FreeLibrary(l_mod);
}
return TRUE;//FALSE
}
[/source]
Second project is called maxCameraPathExporterMFC,which is based on KW X-port source code. The project's fDoExport function calls the IGamExporter's DoExport as below:
[source lang="cpp"]
int __stdcall
fDoExport(const TCHAR *name,
ExpInterface *ei,
Interface *i,
BOOL suppressPrompts,
DWORD options)
{
if(!suppressPrompts)
{
//CDialogExport DialogExport;
//DialogExport.SetExport(name,ei,i,suppressPrompts,options);
//if (DialogExport.DoModal()==IDOK)
{
//((IGameExporterClassDesc*)GetIGameExporterDesc())->Create();
//IGameExporter* pIGameExporter=(IGameExporterClassDesc*)GetIGameExporterDesc())->GetIGameExporter();
IGameExporter* pIGameExporter=new IGameExporter();
pIGameExporter->DoExport(name,ei,i,suppressPrompts,options);
delete pIGameExporter;
}
}
return TRUE;
}
[/source]
I export XFile by first project's dll, and then call the second project's fDoExport. The XFile is really exported successfully. But when I close the 3ds max, it appears an error message of Unhandle exception (http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/3ds%20max%20two%20%20plugin%20error%20Q2.JPG).
Colud somebody tell how to solve this probolem?
I put the complete source code at the web (http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/maxCameraPathQ2.rar) |
|