Click here to Skip to main content
15,888,802 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Jagged arrays in MC++ Pin
Paul Selormey21-Apr-03 19:59
Paul Selormey21-Apr-03 19:59 
QuestionWhat's the difference between VC++ and Managed C++? Pin
BoudewijnEctor14-Apr-03 8:45
BoudewijnEctor14-Apr-03 8:45 
AnswerRe: What's the difference between VC++ and Managed C++? Pin
Maximilien14-Apr-03 8:53
Maximilien14-Apr-03 8:53 
AnswerRe: What's the difference between VC++ and Managed C++? Pin
Natty Gur14-Apr-03 18:46
Natty Gur14-Apr-03 18:46 
QuestionHow to cast a pointer to a member function into a void*? Pin
Charles Liu14-Apr-03 2:45
Charles Liu14-Apr-03 2:45 
AnswerRe: How to cast a pointer to a member function into a void*? Pin
Natty Gur14-Apr-03 4:43
Natty Gur14-Apr-03 4:43 
AnswerRe: How to cast a pointer to a member function into a void*? Pin
John R. Shaw29-Apr-03 18:41
John R. Shaw29-Apr-03 18:41 
Generalcast to c++ interface from C# Pin
bwells14-Apr-03 0:42
bwells14-Apr-03 0:42 
I get a runtime error when I cast an object to an interface the class implments. The class and interface are both managed C++, and the cast in done in C#.

I have narrowed the problem down to a simple case:

1) C# constructs an object defined in managed C++
2) C# casts object to a managed C++ interface it implements
3) C# call method on the object after the cast.

If I do this, I get a runtime exception. I have seen an invalid cast exception, and sometimes I get a format exception that says "the format specific is not allowed...". It seems like the runtime gets very confused.

But instead if I do the following;

1) C# constructs a object defined in managed C++
2) C# stores object in variable as its actual type; not the interface
3) C# calls method on class

it all works.

The problem comes when C# casts a managed C++ object to be its interface type (the interface is also defined as a managed C++ interface).

I have not found anyone who has done what I am trying to do, and I have not found any documentaion that talks about this, so perhaps its not recommended.

Does anyone have experience mixing managed C++ and C# with interfaces defined in C++ and casts to the interface being done form C#?

thanks
Bryan
GeneralRe: cast to c++ interface from C# Pin
Natty Gur14-Apr-03 4:48
Natty Gur14-Apr-03 4:48 
GeneralRe: cast to c++ interface from C# Pin
bwells14-Apr-03 13:58
bwells14-Apr-03 13:58 
GeneralRe: cast to c++ interface from C# Pin
Natty Gur14-Apr-03 17:34
Natty Gur14-Apr-03 17:34 
GeneralRe: cast to c++ interface from C# Pin
bwells16-Apr-03 12:57
bwells16-Apr-03 12:57 
GeneralRe: cast to c++ interface from C# Pin
Natty Gur16-Apr-03 20:11
Natty Gur16-Apr-03 20:11 
GeneralUnmanaged code to call managed code Pin
onyxbird10-Apr-03 9:43
onyxbird10-Apr-03 9:43 
GeneralRe: Unmanaged code to call managed code Pin
Paul Selormey10-Apr-03 18:03
Paul Selormey10-Apr-03 18:03 
GeneralC2682: cannot use __try_cast to convert from 'gcroot<T>' Pin
Paul Selormey31-Mar-03 20:40
Paul Selormey31-Mar-03 20:40 
GeneralRe: C2682: cannot use __try_cast to convert from 'gcroot<T>' Pin
Paul Selormey1-Apr-03 0:51
Paul Selormey1-Apr-03 0:51 
GeneralMixing ATL and MC++ Pin
Heath Stewart26-Mar-03 3:17
protectorHeath Stewart26-Mar-03 3:17 
GeneralRe: Mixing ATL and MC++ Pin
Paul Selormey26-Mar-03 13:29
Paul Selormey26-Mar-03 13:29 
GeneralCovariant return types Pin
VizOne24-Mar-03 22:52
VizOne24-Mar-03 22:52 
GeneralRe: Covariant return types Pin
Paul Selormey26-Mar-03 0:41
Paul Selormey26-Mar-03 0:41 
GeneralRe: Covariant return types Pin
VizOne26-Mar-03 0:53
VizOne26-Mar-03 0:53 
GeneralRe: Covariant return types Pin
Paul Selormey26-Mar-03 1:12
Paul Selormey26-Mar-03 1:12 
GeneralRe: Covariant return types Pin
VizOne26-Mar-03 8:35
VizOne26-Mar-03 8:35 
GeneralRe: Covariant return types Pin
Paul Selormey26-Mar-03 13:22
Paul Selormey26-Mar-03 13:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.