CGdiObject error C4482
While compiling a project that 100% clean compiles under VC6, I am getting the following error:
e:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(259) : error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'
e:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(540) : see declaration of 'CObject::operator ='
e:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(510) : see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CGdiObject &CGdiObject::operator =(const CGdiObject &)'
There is no reference to the line of code in my project that is provoking this error. The CPP file listed immediately before this error does not use in itself any GDI objects. I have tried compiling with various listings enabled to try to locate what is provoking the error but am making no progress.
Any ideas anyone?
[997 byte] By [
Tim42] at [2007-12-16]
Thats the problem - there are no GDI related classes in the cpp or .h file preceeding. All the .h files included are included elsewhere for other cpp files - about 1500 of them in total. Removing the preceeding cpp file removes the error. I have searched the entire project for CPen, CBrush etc - there are very few as it is an MDI Property Sheet / Page / Dialog based database client server app (IE very little GDI).
So, to recap. This was a MSVC6 project (still is, this is a test run at conversion / learning exercise) that compiled 100% ok under vc6 and vc8. I then added CLR support with a hand ful of errors (one with HTREEITEM) and this error + a 35MB debug executable. (The release build comes in under 3 mb normally). The IDE has bloated to 7-800MB during the compile...
Are there any switches to produce the expanded C++ code for this 1 file? I tried some settings and one produced a 6+MB file that I searched for GDI objects in without success. The cpp file concerned is only a few hundred lines.
Ideas?
Hi,
Could you please try separating this cpp file from the rest of the project and compile it? Will it still give same errors?
Is it possible if you email me this file? Try zip it and email it to nikolad on microsoft dot com.
Thanks,
Nikola