powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / C++ [игнор отключен] [закрыт для гостей] / Присвоение Object
2 сообщений из 2, страница 1 из 1
Присвоение Object
    #33798139
Савилов
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
#pragma once
#include "afx.h"

class CTextFile : public CStdioFile
{
	CFile file;	
public:
	CTextFile(CFile *arg);
	CTextFile(CFile *arg,CString encoding);
	~CTextFile(void);
};

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
#include "StdAfx.h"
#include "TextFile.h"

CTextFile::CTextFile(CFile *arg)
{
	file=arg;	
}

CTextFile::CTextFile(CFile *arg,CString encoding)
{
	
}

CTextFile::~CTextFile(void)
{
	
}

Почему так?

------ Build started: Project: AscrUpdate, Configuration: Debug Win32 ------
Compiling...
TextFile.cpp
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(1254) : error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(524) : see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CFile &CFile::operator =(const CFile &)'
...
Рейтинг: 0 / 0
Присвоение Object
    #33798782
Alex_VC
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
#pragma once
#include "afx.h"

class CTextFile : public CStdioFile
{
	CFile *file;	//А если так?
public:
	CTextFile(CFile *arg);
	CTextFile(CFile *arg,CString encoding);
	~CTextFile(void);
};
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / C++ [игнор отключен] [закрыт для гостей] / Присвоение Object
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]