is not a member of tform1

I have to make a chess program in C-builder for my OOP course. (object oriented programming)

I made a class Piece and created, inside this class, a TImage imPiece. Now I want to assign this image an Event OnClick using a function from the main class.

[C++ Error] Piece.cpp(20): E2316 ‘Move’ is not a member of ‘TForm’

1 Answer 1

Look very carefully at your Piece() code. It has its own fJoc input parameter that is of type TForm* . When it tries to access fJoc->Move , and compiler complains:

And that error is correct. The TForm class does not have a member named Move . Move is actually a member of your TfJoc class instead.

So, you need to either

change the input parameter to TfJoc* instead of TForm*

just get rid of the input parameter altogether and use the global fJoc pointer that is declared in formaJoc.h (assuming your TfJoc object is auto-created at program startup).

Ошибка: [C++ Error] Unit2.cpp(51): E2316 ‘AA’ is not a member of ‘TForm1’

#include «Unit1.h» и
#include «Unit2.h» и там и там объявлены.

Причем, какие-то ранее написанные куски кода вопроса не вызывают. Появилась проблема вдруг и ошибка появляется при обращении к любым переменным из Unit1.
Помогите.
/В программировании полный 0, так что попроще, если можно/
Спасибо.

is not a member of ‘TForm1’ . why.

is not a member of ‘TForm1’ . why.

I have one project with some source files. I have the main source file (main.cpp) and it header file (main.h) where are declared all the objects on the form. In one of the oters source files (other.cpp) i needed to use some objects in the form, so i had the line #include «main.h» to ‘other.cpp’ to be able to use them. And it worked fine.

Then i sent this project to a friend and he cant compile it.
ghe gets erros like:
[C++ Error] other.cpp(268): E2316 ‘check_box1’ is not a member of ‘TForm1’
[C++ Error] other.cpp(268): E2316 ‘check_box2’ is not a member of ‘TForm1’

Why does the project compile in my computer and not in his?
Please help. it’s very importante. Thanks in advance.

RE: is not a member of ‘TForm1’ . why.

are You sure that You sent YOur friend the file «other.cpp»?

and is he sure, that he loaded Your project?

when bcb starts up, it has a project with tform1 as default opened, which of course not has your checkboxes.

rename Your project and let him opne this one.
let him in the options of this opened project chek for the path settings, which would differ o his machine, when he installed bcb somewhere else than You.

try this and get back.

RE: is not a member of ‘TForm1’ . why.

RE: is not a member of ‘TForm1’ . why.

James P. Cottingham

There’s no place like 127.0.0.1.
There’s no place like 127.0.0.1.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Оцените статью