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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】[arx]类之间成员调用问题 初学者的难题! (http://www.dimcax.com/hust/showthread.php?t=6499)

yang686526 2009-04-16 12:31 PM

【转帖】[arx]类之间成员调用问题 初学者的难题!
 
[arx]类之间成员调用问题 初学者的难题!
[arx]类之间成员调用问题 初学者的难题!
建立了一个dlg类:cattribute,对话框中idd_attribute有combo box,其名字为: idc_style
其中的data有:用地选址
用地许可证
用地设计要点
用向导建立成员如下:
control ids:idc_style
type:cstring
member:m_cs
现在我需要在另一个类中调用attributecommands.cpp:
#include "stdafx.h"
#include "stdarx.h"
#include "cattribute.h"
int choose()
{
if (cattribute::m_cs="用地选址") //这样写是错误的 谁能给个正确的方法?
return 1;
else if( cattribute::m_cs="用地许可证")
return 2;
else if (cattribute::m_cs="用地设计要点")
return 3;
}
详细函数如下:
cattribute.h:
class cattribute : public cdialog
{
// construction
public:
cattribute(cwnd* pparent = null);
enum { idd = idd_attribute };
cstring m_cs;
.......
触发事件:
cattribute.cpp:
void cattribute::onok()
{ if (m_cs="用地选址")
createnewlayernew("选址红线",m_cs);
else if ( m_cs="市政要点")
createnewlayernew("市政要点红线",m_cs);
else
createnewlayernew("其他红线",m_cs);
}
createnewlayernew(....){....}
c++的基本问题:其实问题就是一句话:
对话框类cattribute的combo box的成员m_cs,在attributecommands.cpp中如何调用!

可惜我这个菜鸟研究了半天没成果!哪为大虾帮忙看看!
class a
{
public:
int m_ncount;
}
a a;
a.m_ncount = 0;


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