找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 244|回复: 2

[求助]:做了一个简单的arx 使用了arx向导做了一个闪屏的功能,然后就不能卸载arx 了

[复制链接]
发表于 2004-5-18 10:22:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
做了一个简单的arx 使用了arx向导做了一个闪屏的功能,然后就不能卸载arx 了 不知道arx在哪里被锁定了?


  1. HINSTANCE _hdllInstance =NULL ;


  2. HICON tmg_acadicon;

  3. // This command registers an ARX command.
  4. void AddCommand(const char* cmdGroup, const char* cmdInt, const char* cmdLoc,
  5.                                 const int cmdFlags, const AcRxFunctionPtr cmdProc, const int idLocal = -1);


  6. // NOTE: DO NOT edit the following lines.
  7. //{{AFX_ARX_MSG
  8. void InitApplication();
  9. void UnloadApplication();
  10. //}}AFX_ARX_MSG

  11. // NOTE: DO NOT edit the following lines.
  12. //{{AFX_ARX_ADDIN_FUNCS
  13. //}}AFX_ARX_ADDIN_FUNCS


  14. ////////////////////////////////////////////////////////////////////////////
  15. //
  16. // Define the sole extension module object.
  17. AC_IMPLEMENT_EXTENSION_MODULE(TmInitDLL);

  18. // Now you can use the CAcModuleResourceOverride class in
  19. // your application to switch to the correct resource instance.
  20. // Please see the ObjectARX Documentation for more details

  21. /////////////////////////////////////////////////////////////////////////////
  22. // DLL Entry Point
  23. extern "C"
  24. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  25. {
  26.         if (dwReason == DLL_PROCESS_ATTACH)
  27.         {
  28.         _hdllInstance = hInstance;
  29.                 // Extension DLL one time initialization
  30.                 TmInitDLL.AttachInstance(hInstance);
  31.                 InitAcUiDLL();
  32.         } else if (dwReason == DLL_PROCESS_DETACH) {
  33.                 // Terminate the library before destructors are called
  34.                 TmInitDLL.DetachInstance();

  35.         }
  36.         return TRUE;    // ok
  37. }



  38. /////////////////////////////////////////////////////////////////////////////
  39. // ObjectARX EntryPoint
  40. extern "C" AcRx::AppRetCode
  41. acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
  42. {
  43.         switch (msg) {
  44.         case AcRx::kInitAppMsg:
  45.                 AfxSetResourceHandle (_hdllInstance) ;   //
  46.                 CSplashScreen::EnableSplashScreen (TRUE) ;
  47.                 CSplashScreen::ShowSplashScreen (acedGetAcadFrame ()) ;
  48.                 AfxSetResourceHandle (acedGetAcadResourceInstance ()) ;
  49.                 // Comment out the following line if your
  50.                 // application should be locked into memory

  51.                 acrxDynamicLinker->unlockApplication(pkt);
  52.                 acrxDynamicLinker->registerAppMDIAware(pkt);
  53.                 InitApplication();
  54.                 break;
  55.         case AcRx::kUnloadAppMsg:
  56.         //        acrxDynamicLinker->unlockApplication(pkt); //这里也没有解锁  这里显示 在用arx命令卸载这个程序的时候没有执行到这里?
  57.                 UnloadApplication();

  58.                 break;
  59.         }
  60.         return AcRx::kRetOK;
  61. }

  62. // Init this application. Register your
  63. // commands, reactors...
  64. void InitApplication()
  65. {
  66.         // NOTE: DO NOT edit the following lines.
  67.         //{{AFX_ARX_INIT
  68.         AddCommand("TMITSABOUT", "TSABOUT", "TSABOUT", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, tmtsAbout);
  69.         //}}AFX_ARX_INIT

  70.         // TODO: add your initialization functions
  71.         //  更换cad图标
  72.        
  73.         UINT nIDIcon=IDI_ICONHEAD;
  74.         CString  strWinText;
  75.         oxaSetFrameIcon(nIDIcon, strWinText);
  76.        
  77. }

  78. // Unload this application. Unregister all objects
  79. // registered in InitApplication.
  80. void UnloadApplication()
  81. {
  82.         // NOTE: DO NOT edit the following lines.
  83.         //{{AFX_ARX_EXIT
  84.         acedRegCmds->removeGroup("TMITSABOUT");
  85.         //}}AFX_ARX_EXIT

  86.         // TODO: clean up your application
  87.   oxaResetFrameIcon(tmg_acadicon);

  88. }

  89. // This functions registers an ARX command.
  90. // It can be used to read the localized command name
  91. // from a string table stored in the resources.
  92. void AddCommand(const char* cmdGroup, const char* cmdInt, const char* cmdLoc,
  93.                                 const int cmdFlags, const AcRxFunctionPtr cmdProc, const int idLocal)
  94. {
  95.         char cmdLocRes[65];

  96.         // If idLocal is not -1, it's treated as an ID for
  97.         // a string stored in the resources.
  98.         if (idLocal != -1) {

  99.                 // Load strings from the string table and register the command.
  100.                 ::LoadString(_hdllInstance, idLocal, cmdLocRes, 64);
  101.                 acedRegCmds->addCommand(cmdGroup, cmdInt, cmdLocRes, cmdFlags, cmdProc);

  102.         } else
  103.                 // idLocal is -1, so the 'hard coded'
  104.                 // localized function name is used.
  105.                 acedRegCmds->addCommand(cmdGroup, cmdInt, cmdLoc, cmdFlags, cmdProc);
  106. }
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2004-5-19 22:19:32 | 显示全部楼层

  1. /////////////////////////////////////////////////////////////////////////////
  2. // ObjectARX EntryPoint
  3. extern "C" AcRx::AppRetCode
  4. acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
  5. {
  6.         switch (msg) {
  7.         case AcRx::kInitAppMsg:
  8.                 AfxSetResourceHandle (_hdllInstance) ;   //
  9.                 CSplashScreen::EnableSplashScreen (TRUE) ;
  10.                 CSplashScreen::ShowSplashScreen (acedGetAcadFrame ()) ;
  11.                 AfxSetResourceHandle (acedGetAcadResourceInstance ()) ;
  12.                 // Comment out the following line if your
  13.                 // application should be locked into memory
  14. [COLOR=Red]
  15.                 acrxDynamicLinker->unlockApplication(pkt);
  16.                 acrxDynamicLinker->registerAppMDIAware(pkt); [/COLOR]
  17.                 InitApplication();
  18.                 break;
复制代码

------------------------->try as follow pls:

  1. case AcRx::kInitAppMsg:
  2. [COLOR=Blue]
  3.         // at first position
  4.         acrxDynamicLinker->unlockApplication(pkt);
  5.         acrxDynamicLinker->registerAppMDIAware(pkt);
  6. [/COLOR]
  7.         AfxSetResourceHandle (_hdllInstance) ;   //
  8.         CSplashScreen::EnableSplashScreen (TRUE) ;
  9.         CSplashScreen::ShowSplashScreen (acedGetAcadFrame ()) ;
  10.         AfxSetResourceHandle (acedGetAcadResourceInstance ()) ;
  11.         // Comment out the following line if your
  12.         // application should be locked into memory

  13.        InitApplication();   [COLOR=Red]// ????  it my be to up postion, too.[/COLOR]
  14.        break;
复制代码
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-5-20 12:08:41 | 显示全部楼层
没有什么变化  InitApplication();  也提前了

//
  1.                 AfxSetResourceHandle (_hdllInstance) ;   
  2.                 CSplashScreen::EnableSplashScreen (TRUE) ;
  3.                 CSplashScreen::ShowSplashScreen (acedGetAcadFrame ()) ;
  4.                 AfxSetResourceHandle (acedGetAcadResourceInstance ()) ;
  5. [COLOR=crimson]                   acrxDynamicLinker->unlockApplication(pkt);
  6.                 acrxDynamicLinker->registerAppMDIAware(pkt);
  7.    [/COLOR]
复制代码

如果该成这样       
  1. [COLOR=crimson]   
  2.         acrxDynamicLinker->unlockApplication(pkt);
  3.                 acrxDynamicLinker->registerAppMDIAware(pkt);      [/COLOR]

  4.                 AfxSetResourceHandle (_hdllInstance) ;   
  5.                 CSplashScreen::EnableSplashScreen (TRUE) ;
  6.                 CSplashScreen::ShowSplashScreen (acedGetAcadFrame ()) ;
  7.                 AfxSetResourceHandle (acedGetAcadResourceInstance ()) ;
复制代码

             导致AutoCAD无法使用其他资源 打开图形就致命错误!!
   [/COLOR]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-9-21 18:45 , Processed in 0.370717 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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