Home > Software engineering >  Under VC6 transplanted into VS2010 compilation
Under VC6 transplanted into VS2010 compilation

Time:10-01

I come from CArray derived a CArrayGraph2 definition of two-dimensional array
And the overloaded operator=,
Then
Typedef CArray ARRINT;
Typedef CArrayGraph2 ARRINT2;
Defines a ARRINT2 as a two dimensional array of type int, but as long as the
in functionA call the array RemoveAll is compiled through, however, don't know is which there is a problem,
But under VC6, or under the normal VS2010 project can be compiled through,
Only in dynamic library project compilation pass
The dynamic library defines a function
 TESTARRAY_API int fntestarray (ARRINT2 & amp; ArrInterIndex) 
{
ArrInterIndex. RemoveAll ();//put the shielding can compile
return 0;
}

https://pan.baidu.com/s/1boBOiZX project source code can be downloaded here
Error message is as follows:
D: \ \ program files \ Microsoft visual studio 10.0 \ \ vc atlmfc \ include \ afxtempl h (262) : error C2248: "CObject: : operator=" : unable to access private members (in "CObject" class declarations)
1> D: \ \ program files \ Microsoft visual studio 10.0 \ \ vc atlmfc \ include \ afx h (535) : see "CObject: : operator=" statement
1> D: \ \ program files \ Microsoft visual studio 10.0 \ \ vc atlmfc \ include \ afx h (509) : see "CObject statement
"1> The diagnosis in the compiler to generate the function of "CArray & amp; CArray: : operator=(const CArray & amp;) "
1> With
1>
1> TYPE=int,
1> ARG_TYPE=int
1> ]

CodePudding user response:

The error C2248 -
Code through transfer iostream object by value, rather than the way of reference, will transfer value to reference,

Is changed to the address

CodePudding user response:

Error information is not complete, if it is RemoveAll caused by mistake, should eventually be traced back to RemoveAll this line, but posted the wrong said last hanging in CArray & amp; CArray: : operator=(const CArray & amp;) Inside,

CodePudding user response:

RemoveAll ()
=========
This code stick out and have a look

CodePudding user response:

Your operator=": there is a problem

CodePudding user response:

Dynamic library export interface suggested in
1 USES pointer *
2 use the basic data types

CodePudding user response:

Don't transplant,
Using VC6 in WinXP virtual machine,
  • Related