- UID
- 5043
- 积分
- 1347
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-13
- 最后登录
- 1970-1-1
|
发表于 2004-5-31 00:18:09
|
显示全部楼层
Re: [求助]:如何使用程序卸载一个已经加载的.ARX程序?
最初由 robot 发布
[B]刚刚学习ObjectARX编程,遇到一个问题“如何卸载一个已经加载的.ARX程序?”
我想解决的方法有三种:
一、在AutoCAD中调用Appload命令卸载已经加载的程序;
二、使用所加载程序中自身的卸载命令;
三、调用第三个... [/B]
使用:
[php]
AcRxDynamicLinker::unloadApp Function virtual bool
unloadApp(
const char * appName,
bool asCmd = false) = 0;
appName Input null-terminated string which is the application name (as
set in the system registry) of the ObjectARX module to unload
asCmd Input Boolean indicating whether to unload the application as if by
user command
This function unloads the appName ObjectARX program. appName is the
application name as set in the operating system registry. If the ObjectARX
application was not loaded via the AcRxDynamicLinker::loadApp() or
acrxLoadApp() methods or through the demand loading mechanism (all of
which use the system registry entry for the application), then this function
will be unable to unload the application.
When asCmd is kFalse, it's possible to call this method more than once
and still get a successful return value. This method will simply decrement
the reference count for the application.
Note The asCmd value used for unloadApp() must be the same as the
one used for loadApp().
The function returns true if the module was successfully unloaded;
otherwise, it returns false.
[/php]
[php]
AcRxDynamicLinker::unloadModule Function virtual bool
unloadModule(
const char* fileName,
bool asCmd = false) = 0;
fileName Input null-terminated string which is the file name of the program
to unload
asCmd Input Boolean indicating whether to unload the application as if by
user command
This function unloads the ObjectARX module filename. Before physically
unloading the module, the application's acrxEntryPoint() function is called
with the kUnloadAppMsg message to allow it to perform cleanup.
Notification is also sent about the impending unload.
Note The fileName string is case and path sensitive, so it must be either
exactly the same as string that was used to load the application or it must
be the same as the string returned by the ads_arxloaded() function.
When asCmd is kFalse, it's possible to call this method more than once
and still get a successful return value. This method will simply decrement
the reference count for the application.
Note The asCmd value used for unloadModule() must be the same as the
one used for loadModule().
[/php] |
|