- 积分
- 380
- 明经币
- 个
- 注册时间
- 2004-4-15
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我用PDB编写的dcl对话框运行正确,怎么加载不上呢。高手帮我看看,
#include <aced.h> #include <rxregsvc.h> #include <adscodes.h> #include "adsdlg.h"
void initApp(); void unloadApp(); void mydcl(); void CALLB print_cb(ads_callback_packet *cpkt); void CALLB ok_cb(ads_callback_packet *cpkt);
//.............................. 接口函数部分 .................................. void initApp() { acedRegCmds->addCommand("mydcl_COMMANDS", "mydcl", "mydcl", ACRX_CMD_TRANSPARENT , mydcl); } void unloadApp() { acedRegCmds->removeGroup("mydcl_COMMANDS"); } extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt) { switch (msg) { case AcRx::kInitAppMsg: acrxDynamicLinker->unlockApplication(pkt); acrxRegisterAppMDIAware(pkt); initApp(); break; case AcRx::kUnloadAppMsg: unloadApp(); break; default: break; } return AcRx::kRetOK; }
void mydcl(void) { ads_hdlg hDlg; int dcl_id,what_next; ads_load_dialog("mydcl.dcl", &dcl_id); if(ads_new_dialog("mydcl",dcl_id,NULLCB,&hDlg)!=RTNORM) { acedPrompt("无法初始化对话框!\n"); acedRetVoid(); } ads_action_tile(hDlg, "print", print_cb); ads_action_tile(hDlg, "accept", ok_cb); ads_start_dialog(hDlg, &what_next); ads_unload_dialog(dcl_id); acedRetVoid(); } static void CALLB print_cb(ads_callback_packet *cpkt) { char tbuf[80]; ads_get_tile(cpkt->dialog, "your_name", tbuf, MAX_TILE_STR); acutPrintf("\n 刚才输入的姓名为:%s",tbuf); } static void CALLB ok_cb(ads_callback_packet *cpkt) { ads_done_dialog(cpkt->dialog,DLGOK); }
.DCL是:
mydcl:dialog label="对话框"; :edit_box label="输入你的姓名:"; key="your_name"; } :button label="输出"; key="print"; fixed=width=true; alignment=centered; } ok_only; }
.def文件是:
DESCRIPTION LIBRARY mydcl EXPORTS acrxEntryPoint PRIVATE acrxGetApiVersion PRIVATE
|
|