- UID
- 124967
- 积分
- 180
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-4-14
- 最后登录
- 1970-1-1
|
发表于 2005-4-29 02:33:00
|
显示全部楼层
请在弹出你自己的对话框时加上如下语句:
CAcModuleResourceOverride thisResource;
这是起临时切换资源的作用,如果没有这句话,一般都会提示“unsupported operat"错误。
以下是Arx帮助系统里的说明。
Resource management is an important consideration when designing an ObjectARX application that uses an MFC library shared with AutoCAD and other applications.
You must insert your module state (using CDynLinkLibrary) into the chain that MFC examines when it performs operations such as locating a resource. However, it is strongly recommended that you explicitly manage your application's resources so that they will not conflict with other resources from AutoCAD or other ObjectARX applications.
To explicitly set resources
Before taking any steps that would cause MFC to look for your resource, call the AFX function AfxSetResourceHandle() to set the custom resource as the system default.
Before setting the system resource to your resource, call AfxGetResourceHandle() to get the current system resource.
Immediately after performing any functions that require the custom resource, the system resource should be reset to the resource handle previously saved.
Calling AutoCAD API functions (or invoking AutoCAD commands) inside the dialog command handler that needs AutoCAD's resources, such as acedGetFileD(), sets the resource back to AutoCAD before calling the functions. Restore your application resource afterwards. (Use acedGetAcadResourceInstance() to get AutoCAD's resource handle.) |
|