How to make a managed method overridable 
Author Message
 How to make a managed method overridable

I have wrapped a set of C++ classes with managed code.  
all seems to be going well until I try to use VB.NET to
inherit from a C++ managed class and then override a
method of that C++ class.

The inheritance piece works fine - but when I try to
override the method, I get a compiler error "method not
marked as overridable".

Do I need to do something on the managed C++ side in
order to make the method(s) overridable?

Thanks in advance for any replies.

Jeff



Mon, 19 Sep 2005 01:39:16 GMT  
 How to make a managed method overridable

--------------------

Quote:
> Content-Class: urn:content-classes:message


> Subject: How to make a managed method overridable
> Date: Wed, 2 Apr 2003 09:39:16 -0800
> I have wrapped a set of C++ classes with managed code.  
> all seems to be going well until I try to use VB.NET to
> inherit from a C++ managed class and then override a
> method of that C++ class.

> The inheritance piece works fine - but when I try to
> override the method, I get a compiler error "method not
> marked as overridable".

> Do I need to do something on the managed C++ side in
> order to make the method(s) overridable?

> Thanks in advance for any replies.

> Jeff

You probably did not declare the method in the wrapped class as 'virtual'.
If that doesn't work, we need to look at your code snippet to see what is
going wrong.

--
Siva Challa, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm



Wed, 21 Sep 2005 02:45:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. singleton with overridable methods

2. Making managed wrapper for legacy unmanaged classes.

3. Presenting a managed collection to an unmanaged method.

4. How to make a method on a managed C++ class visible to COM

5. C++ Dot net: calling managed method from unmanaged code

6. Is it possible to have an unmanaged method in a managed class

7. Calling COM method from managed c++ client

8. Managed extensions with method parameter as reference

9. Managed extensions with method parameter as reference

10. InterBase: last night I have none of method call to InterBase API made success in VC++,

11. managed code vs. non-managed code

12. using Managed dlls from Managed C++

 

 
Powered by phpBB® Forum Software