几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » ObjectARX(C++)
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-16, 07:46 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】停靠栏的问题,希望好心人帮帮忙看看,问题该怎么解决

停靠栏的问题,希望好心人帮帮忙看看,问题该怎么解决
停靠栏的问题,希望好心人帮帮忙看看,问题该怎么解决
我在停靠栏上放了listcontrol控件,代码如下:要实现当停靠栏显示时,listcontrol中的数据也显示出来!extern _connectionptr pconn;
bool cacdialogbar::create (cframewnd *pparent, uint nidtemplate, uint style, uint nid) {
if ( !cdialogbar::create (pparent, nidtemplate, style, nid) )
return (false) ;
msizecurrent =m_sizedefault ;
cacdialogbar m_mybar;
m_ctrlcopeople.subclassdlgitem(idc_ls_copeople,this);
dword dwstyle = m_ctrlcopeople.getextendedstyle();
dwstyle |= lvs_ex_fullrowselect dwstyle |= lvs_ex_gridlines;
m_ctrlcopeople.setextendedstyle(dwstyle); //设置扩展风格
m_ctrlcopeople.insertcolumn(0,"协同用户");
m_ctrlcopeople.insertcolumn(1,"协同方式");
m_ctrlcopeople.insertcolumn(2,"用户ip");
m_ctrlcopeople.insertcolumn(3,"协同项目");
m_ctrlcopeople.insertcolumn(4,"协同模块");
m_ctrlcopeople.setcolumnwidth(0,100);//设置列的宽度。
m_ctrlcopeople.setcolumnwidth(1,100);
m_ctrlcopeople.setcolumnwidth(2,100);
m_ctrlcopeople.setcolumnwidth(3,100);
m_ctrlcopeople.setcolumnwidth(4,100);
cstring vsql,vstrtype,vstrname,vstrip,vstrpid,vstrmid;
_recordsetptr vst;
_variant_t holder;
int i = 0;
vst.createinstance(__uuidof(recordset));
vsql.format("select * from tempcoinfo");
vst->open(_variant_t(vsql),pconn.getinterfaceptr(),adopendynamic,adlockoptimistic,adcmdtext);
if(!vst->adoeof)
{
m_ctrlcopeople.deleteallitems();
vst->movefirst();
while (!vst->adoeof)
{
lv_item lvitem;
lvitem.mask = lvif_text | lvif_image | lvif_state;
lvitem.state = 0;
lvitem.statemask = 0;
//char temp[50];

lvitem.iitem = i;
lvitem.isubitem = 0;
//lvitem.psztext =itoa(i, temp, 10);
//m_ctrlcopeople.insertitem(&lvitem);
holder=vst->getcollect("temptype");
vstrtype = holder.vt==vt_null?""char *)(_bstr_t)holder;
holder=vst->getcollect("tempname");
vstrname= holder.vt==vt_null?""char *)(_bstr_t)holder;
holder=vst->getcollect("tempip");
vstrip= holder.vt==vt_null?""char *)(_bstr_t)holder;
holder=vst->getcollect("coprojectid");
vstrpid= holder.vt==vt_null?""char *)(_bstr_t)holder;
holder=vst->getcollect("comodeid");
vstrmid= holder.vt==vt_null?""char *)(_bstr_t)holder;

lvitem.psztext =(lpstr)lpcstr(vstrname) ;
m_ctrlcopeople.insertitem(&lvitem);
m_ctrlcopeople.setitemtext(i,1,(lpctstr)vstrtype); m_ctrlcopeople.setitemtext(i,2,(lpctstr)vstrip);
m_ctrlcopeople.setitemtext(i,3,(lpctstr)vstrpid);
m_ctrlcopeople.setitemtext(i,4,(lpctstr)vstrmid);
vst->movenext();
i=i+1;
}

}
vst->close();
delete vst;
return (true) ;
}
可是当运行时,所有m_ctrlcopeople.setitemtext()语句只能在最后一条记录显示出数据来,其余的都不显示查询到的数据,请问该问题怎么解决,谢谢!!!
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 09:26 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多