帮帮我吧!这个问题想了半个月了
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我现在做一个参数化画图的小程序,我以前做的都是通过对话框往图输入数字,比如比例系数<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我现在想往图里边输入字符,我想知道是应该怎么做啊,
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我以前是这么做的,比如说<FONT face="Times New Roman">B</FONT>吧
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">dcl</FONT>对话框里是
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">:edit_box{</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> label="B:";</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> key="B";</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> edit_width=7;</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> }</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">程序里面的接受函数是
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我是先定义
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">static void CALLB Hello_accept(ads_callback_packet *cpkt);</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">ads_real B</FONT>;
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">……
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"><</FONT>对话框调用函数<FONT face="Times New Roman">></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">……
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">static void CALLB Hello_accept(ads_callback_packet *cpkt)//</FONT>接受函数
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">{</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> char val;</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> ads_get_tile(cpkt->dialog, "B", val, MAX_TILE_STR); </FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> acdbDisToF(val,-1,&B); </FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">ads_done_dialog(cpkt->dialog,DLGOK);</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> return ;} </FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我要是想计算的话,就可以直接用<FONT face="Times New Roman">B</FONT>了,
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">但是我想要在<FONT face="Times New Roman">cad</FONT>中输出<FONT face="Times New Roman">B</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我是这么做的
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">void Dimchinese(ads_point pt,char *p)//</FONT>文字标注函数
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> acedCommand(RTSTR,"STYLE",RTSTR,"ZHC1",RTSTR,"·ÂËÎ_GB2312",RTSTR,"5",</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> RTSTR,"0.6",RTSTR,"0",RTSTR,"N",RTSTR,"N",0);</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> acedCommand(RTSTR,"TEXT",RTSTR,"J",RTSTR,"C",RTPOINT,pt,</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> RTSTR,"0",RTSTR,p,0); </FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> acedCommand(RTSTR,"STYLE",RTSTR,"standard",RTSTR,"",RTSTR,"",</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> RTSTR,"",RTSTR,"",RTSTR,"N",RTSTR,"N",RTSTR,"N",0);</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> </FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">pp=66;</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> pp=666;</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman">acdbRToS(B,-1,-1,mm);</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> Dimchinese1(pp, B);</FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">我现在遇到到问题是,我想在对话框里输入字符,我想知道接受函数怎么写,我用文字标注函数就能得到我输入的字符串。
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"> <o:p></o:p></FONT> 不明白楼主的意思,能够输入数字就肯定可以输入字符。
可以进行一下类型转换吗?不懂的说
页:
[1]