尝试从另一个.cpp启动TShape时,成员标识符应出现错误
Member identifier expected error when trying to initiate a TShape from another .cpp
因此,我试图在派生文件中创建并初始化一个TShape对象,并获得预期的E2280成员标识符。这是代码
#include "Data.h"
#include "MainWindow.h"
#include <vcl.h>
class item{
public:
TShape *Forma;
TImage *Imagine;
TLabel *Denumire, *Set, *Stat, *Price, *Weight, *Effect, *Type, *ID;
TButton *Equip;
item(int k);
};
item::item(int k){
int pozitia_forma=k*130+5;
Forma->new TShape(MainWindow_Form);
Forma->Parent=MainWindow_Form->ScrollBox;
Forma->Height=130;
Forma->Width=370;
Forma->Top=pozitia_forma;
Forma->Left=5;
}
此语法错误:
Forma->new TShape(MainWindow_Form);
看起来你需要
Forma = new TShape(MainWindow_Form);
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 对RValue对象调用的LValue ref限定成员函数
- 为什么使用 "this" 指针调用派生成员函数?
- 具有奇怪重复模板模式的派生类中的成员变量已损坏
- 助记符和指向成员语法的指针
- 用于访问容器<T>数据成员的正确 API
- 内置函数可查看CPP中的成员变量
- 是否可以初始化不可复制类型的成员变量(或基类)
- 如果C++类在类方法中具有动态分配,但没有构造函数/析构函数或任何非静态成员,那么它仍然是POD类型吗
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 什么是更好的做法?通过指针或标识符传递类成员?
- 从子类访问模板类成员时出现"找不到标识符"错误
- 声明与 const 变量和成员函数相同的标识符
- 当枚举器列表项的标识符已是结构的成员时,如何使用枚举器列表项
- 没有成员作为唯一标识符的两个类实例的比较
- c++类成员与成员函数参数相同的标识符
- 是否可以仅通过标识符检查成员模板的存在
- Shared_ptr对抽象基类(成员变量)是一个未声明的标识符
- 链接器2001错误和未定义的成员变量标识符
- 尝试从另一个.cpp启动TShape时,成员标识符应出现错误