I
Ian
1. I want to be use mix unmanaged code with managed code. In particular,
the unmanaged code uses MFC CFile to perform file I/O. Can CFile be used
in unmanaged code that is mixes with managed code? I've tried this but
keep getting a system::exception is thrown with the message "External
component has thrown an exception" when the CFile instance is created.
2. How does the assignment operator check to see that the source and
destination objects are not the same in managed code? For example:
ref class A
{
A% operator=( A %a )
{
// if( this != &a ) // this line generates a compiler error.
{
...
}
}
};
The compile generates the error message "error C2446: '!=' : no conversion
from 'const CManaged' to 'CManaged ^const '" when the line "if( this !=
&a )" is uncommented. While this is to be expected, what is the proper way
to check if the source and destination objects are the same?
Ian
the unmanaged code uses MFC CFile to perform file I/O. Can CFile be used
in unmanaged code that is mixes with managed code? I've tried this but
keep getting a system::exception is thrown with the message "External
component has thrown an exception" when the CFile instance is created.
2. How does the assignment operator check to see that the source and
destination objects are not the same in managed code? For example:
ref class A
{
A% operator=( A %a )
{
// if( this != &a ) // this line generates a compiler error.
{
...
}
}
};
The compile generates the error message "error C2446: '!=' : no conversion
from 'const CManaged' to 'CManaged ^const '" when the line "if( this !=
&a )" is uncommented. While this is to be expected, what is the proper way
to check if the source and destination objects are the same?
Ian