D
Dr Evil
There seems to be a bug in managed VC++ when a class is named
'Object'. The code following demonstrates the problem. Note that if
the class named 'Object' is renamed ( and references to it changed
appropriately ) it compiles ok. It makes no difference if class
Object is fully qualified with the namespace, or if it's put in its
own namespace ( outside of AccountManager ) and fully qualified to
that one. Also, if the AccountManager class is changed in any way: (
remove the destructor, change the property to a method, remove the
IAcctMgrListener interface ), the code compiles. The compiler seems
to be confusing the user defined class Object with System.Object, all
be it an inconsistant confusion... the worst kind!
namespace AccountManager
{
public __gc class Object
{
};
public __gc __interface IAcctMgrListener
{
};
public __gc class IAcctMgrListenerJBridgeCallback :
public AccountManager::Object, public
AccountManager::IAcctMgrListener
{
public:
~IAcctMgrListenerJBridgeCallback(){ };
__property int get_jBridgeCallbackHandle(){return 0;};
};
}
Compiling generates the following error:
error C2594: 'argument' : ambiguous conversions from
'AccountManager::IAcctMgrListenerJBridgeCallback __gc *const ' to
'System::Object __gc *'
This diagnostic occurred in the compiler generated function
'AccountManager::IAcctMgrListenerJBridgeCallback::~IAcctMgrListenerJBridgeCallback'
'Object'. The code following demonstrates the problem. Note that if
the class named 'Object' is renamed ( and references to it changed
appropriately ) it compiles ok. It makes no difference if class
Object is fully qualified with the namespace, or if it's put in its
own namespace ( outside of AccountManager ) and fully qualified to
that one. Also, if the AccountManager class is changed in any way: (
remove the destructor, change the property to a method, remove the
IAcctMgrListener interface ), the code compiles. The compiler seems
to be confusing the user defined class Object with System.Object, all
be it an inconsistant confusion... the worst kind!
namespace AccountManager
{
public __gc class Object
{
};
public __gc __interface IAcctMgrListener
{
};
public __gc class IAcctMgrListenerJBridgeCallback :
public AccountManager::Object, public
AccountManager::IAcctMgrListener
{
public:
~IAcctMgrListenerJBridgeCallback(){ };
__property int get_jBridgeCallbackHandle(){return 0;};
};
}
Compiling generates the following error:
error C2594: 'argument' : ambiguous conversions from
'AccountManager::IAcctMgrListenerJBridgeCallback __gc *const ' to
'System::Object __gc *'
This diagnostic occurred in the compiler generated function
'AccountManager::IAcctMgrListenerJBridgeCallback::~IAcctMgrListenerJBridgeCallback'