Mixing MC++ and C# code: problems with overrides

Hello.

I came across a strange problem while using Resharper in mixed MC++ and C#
solution.

Suppose you have the following MC++ code:


Everything compiles just fine. Now let's try to inherit from ListItemBase in
C#:

When I try to override Bind method using Reshaper it works, but the
"override" keyword gets underlined and it's claimed that "there is no
suitable method for override". Trying to override GetData method we get even
worse problem: Resharper is unable to recognize the type ListItemData.

Hope this information will be enough to reproduce the issue.

With best regards.


3 comments
Comment actions Permalink

Hello again,

Trying to insert GetData override in C# code using Resharper also causes
exception #2976 which is already reported in the Tracker.

Regards.


0
Comment actions Permalink

Maxim,

there was really a problem with modifiers that can be specified in C++
code - they prevented
ReSharper from figuring out the type of the parameter correctly. This bug
has already been fixed (in #85).

"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:c9o2h6$qlp$1@is.intellij.net...

Hello.

>

I came across a strange problem while using Resharper in mixed MC++ and C#
solution.

>

Suppose you have the following MC++ code:

 public __value struct ListItemData
> {
> };
>
> public __gc class VirtualListView
> {
> };
>
>
> public __gc __interface IListItem
> {
>     void Bind(VirtualListView* listView, IntPtr tag);
>     void GetData([Out] ListItemData& itemData);
> };
>
> public __gc class ListItemBase : public IListItem
> {
> public:
>     virtual void Bind(VirtualListView* listView, IntPtr tag)
>     {
>     }
>
>     virtual void GetData([Out] ListItemData& itemData)
>     {
>     }
> };
> ]]>

>

Everything compiles just fine. Now let's try to inherit from ListItemBase

in

C#:

 public class MyListItem : ListItemBase
> {
> }
> ]]>

When I try to override Bind method using Reshaper it works, but the
"override" keyword gets underlined and it's claimed that "there is no
suitable method for override". Trying to override GetData method we get

even

worse problem: Resharper is unable to recognize the type ListItemData.

>

Hope this information will be enough to reproduce the issue.

>

With best regards.

>
>


0
Comment actions Permalink

I'm really glad to hear that. Thanks.


0

Please sign in to leave a comment.