最初由 EMeiMonkey 发布
[B]谢谢XDSoft !
我还有一个问题,在用加载应用对话框中列出了一个已经加载的Arx等应用,有些是灰的,不能修改,是如何实现的呢,还有,我看到加载的有些还是*.mnl文件,这又是如何实现的呢?万分感谢! [/B]
ACAD加载菜单的机制是,加载一个菜单后比如ABC.MNU,会自动查找ABC.MNL,如果这个文件有,就加载它。这个MNL实际上就是一个LISP文件,扩展名不同而已。在这个文件中你加上(arxload "yourApp")就可以加载你需要的ARX文件了。
APPLOAD对话框有些项变灰,是因为这些应用程序定义成了不允许卸载。
当ARX加载后,默认的ARX程序是不允许卸载的,如果希望能卸载,在acrxEntryPoint() 的AcRx::kInitAppMsg 消息处理中,加入解锁代码:
下面是部分代码:
- [FONT=courier new]
- acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
- {
- switch (msg) {
- case AcRx::kInitAppMsg:
- InitModule(_hdllInstance, DLL_PROCESS_ATTACH, NULL);
- [color=blue]acrxUnlockApplication(pkt);[/color]
- [/FONT]
复制代码
下面是帮助文件:

- [FONT=courier new]
- acrxUnlockApplication Global Function bool
- acrxUnlockApplication(
- void* appId);
- appId Input void* from second parameter to acrxEntryPoint() during AcRx::kInitAppMsg call
- When ObjectARX applications are initially loaded, they are locked so they cannot be unloaded until AutoCAD shuts down. This function is a "C" code wrapper for:
- acrxDynamicLinker->unlockApplication(appId);
- which unlocks an application, thus making it unloadable at any time thereafter.
- The appId argument is the void* passed in as the second parameter to the application's acrxEntryPoint() function during the AcRx::kInitAppMsg call that occurs when the application is initially loaded.
- Only the void* passed into acrxEntryPoint() during the AcRx::kInitAppMsg call is valid to be used by this function. So, if this function will be called at any other time the void* passed in during the AcRx::kInitAppMsg call must be stored for later use.
- Returns 1 if the application is successfully unlocked; otherwise, returns 0.
- Include File
- rxregsvc.h [/FONT]
|