游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1379|回复: 0

update 3ds max plugin without restarting 3ds max 2008(Q2)

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2009-2-26 11:12:00 | 显示全部楼层 |阅读模式
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)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-20 06:08

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表