Hi,
I have a field named "BaseClasses" in C++ as in the following simplified
code:
using Collections::Generic::List;
namespace A2M { namespace LipIntrospection {
public ref class BaseClassInfo
{
...
};
public ref class ClassInfo
{
public:
List<BaseClassInfo^> BaseClasses;
...
};
}}
The problem is that when "BaseClasses" is accessed in C#, I get an error
"is not supported in the language". I'm able to use the BaseClassInfo
class without problem and I'm also able to define a List<BaseClassInfo>
in C#. Out of curiosity, I compared the types of the list in C# and C++
and I got the following:
"System.Collections.Generic.List`1[[A2M.LipIntrospection.BaseClassInfo,
LipIntrospection, Version=1.0.2196.29053, Culture=neutral,
PublicKeyToken=null]]"
"System.Collections.Generic.List`1[[A2M.LipIntrospection.BaseClassInfo,
LipIntrospection, Version=1.0.2196.29233, Culture=neutral,
PublicKeyToken=null]]"
Is it possible that C++ and C# are using different versions of the
generic list?
Note that I'm pretty new to .Net and C#, so maybe I'm missing something?
Thx and regards,
Nicolas Fleury 2 5456
"Nicolas Fleury" <ni******@yahoo.com_remove_the_> wrote in message
news:%d********************@news20.bellglobal.com. .. Hi,
I have a field named "BaseClasses" in C++ as in the following simplified code:
using Collections::Generic::List; namespace A2M { namespace LipIntrospection { public ref class BaseClassInfo { ... };
public ref class ClassInfo { public: List<BaseClassInfo^> BaseClasses; ... }; }}
The problem is that when "BaseClasses" is accessed in C#, I get an error "is not supported in the language". I'm able to use the BaseClassInfo class without problem and I'm also able to define a List<BaseClassInfo> in C#. Out of curiosity, I compared the types of the list in C# and C++ and I got the following:
"System.Collections.Generic.List`1[[A2M.LipIntrospection.BaseClassInfo, LipIntrospection, Version=1.0.2196.29053, Culture=neutral, PublicKeyToken=null]]"
"System.Collections.Generic.List`1[[A2M.LipIntrospection.BaseClassInfo, LipIntrospection, Version=1.0.2196.29233, Culture=neutral, PublicKeyToken=null]]"
Is it possible that C++ and C# are using different versions of the generic list?
Note that I'm pretty new to .Net and C#, so maybe I'm missing something?
Thx and regards, Nicolas Fleury
List<BaseClassInfo^> BaseClasses;
should be
List<BaseClassInfo^> ^BaseClasses;
C# does not support stackbased semantics, so you must declare a reference.
Willy.
Willy Denoyette [MVP] wrote: List<BaseClassInfo^> BaseClasses;
should be
List<BaseClassInfo^> ^BaseClasses;
C# does not support stackbased semantics, so you must declare a reference.
Oups. Thx, stupid mistake from me; haven't notice it for this field
because the preceding field was a simple type.
Thx,
Nicolas This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Abhi |
last post by:
In the following hypothetical example I want to build a generic list
of unique string items.
How should I implement the pred function so that it returns true/false
if target string exists in the...
|
by: JAL |
last post by:
Here is my first attempt at a deterministic collection using Generics,
apologies for C#. I will try to convert to C++/cli.
using System;
using System.Collections.Generic;
using System.Text;
...
|
by: Wiktor Zychla [C# MVP] |
last post by:
We do have generic classes, methods and delegates. My question is: what
reason prevents us from having generic properties and indexers?
// impossible
public List<T> GetList<T>
{
get
{
...
}
|
by: crazyone |
last post by:
I've got a gaming framework i'm building and i want to save myself the
trouble of reading and writting the complete game data to a custom file
and load/save it to an XML file but i'm getting...
|
by: Seth Gecko |
last post by:
Hi
I am working with generic lists of various objects and a control
dealing with these lists. For instance:
A parent form holds:
dim Walls as List(Of wall)
dim Segments as List(Of segment)
...
|
by: =?Utf-8?B?QkogU2FmZGll?= |
last post by:
We have a class that has a public property that is of type List<T>. FXCop
generates a DoNotExposeGenericLists error, indicating
"System.Collections.Generic.List<Tis a generic collection designed...
|
by: Suds |
last post by:
Hi,
I'm having an issue with invoking a Generic method that takes Generic Arguments.
My method signature is
public void GenericMethodWithGenericArguments<E, V>(List<EtheFirstList,...
|
by: rkausch |
last post by:
Hello everyone,
I'm writing because I'm frustrated with the implementation of C#'s
generics, and need a workaround. I come from a Java background, and
am currently writing a portion of an...
|
by: Jon Slaughter |
last post by:
I have some code like
if (val.GetType().Name == typeof(List<>).Name)
{
}
which lets me determine if val is a generic list(I've already taken care of
the non-generic part but I'd rather be...
|
by: SimonDotException |
last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |