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