473,465 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MC++ question

Hi,

how would I do the following (in CSharp) with MC++?

C#:
namespace LX
{
public struct Declarations
{
public const string SchemaVersion = "1.0";
}

[XmlRoot(ElementName="LX",
Namespace=Declarations.SchemaVersion,
IsNullable=false),Serializable]
public class LandXML
{
...
}
}

I'm trying to do it something like this in MC++:

namespace LX {

__gc struct Declarations {
public:
static const System::String* SchemaVersion = "1.0";
};

[XmlRootAttribute(Namespace=Declarations::SchemaVer sion,
ElementName="LandXML", IsNullable=false),
SerializableAttribute]
public __gc class LandXML {
...
};
}

But this won't compile:
error C2363: cannot evaluate argument 'Declarations::SchemaVersion' of
custom attribute 'XmlRootAttribute'
Apparently, a custom attribute can only have arguments that can be
evaluated at compile time.
What am I doing wrong?
Thanks!

--
Daniel
Jul 21 '05 #1
0 1244

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vladimir Scherbina Nickolaevich | last post by:
hello all, I need to hook some event handler in Managed C++code into event, that is declared, and is fired in C# code. as i understand, this maybe achieved via __hook, but when i write code...
3
by: Philip | last post by:
I am invoking a mc++ method from C# via an unsafe code block. The reason for the unsafe code block is that I am receiving a int as a return parameter. I am invoking the method with a "ref...
4
by: Daniel Lidström | last post by:
Hello, is it possible to ``use CS to code a class, and (M)C++ for the logic''? Sorry if this sounds vague, I'm not really sure myself what it means. Does anyone have any ideas? -- Daniel
0
by: Sam Carleton | last post by:
I am looking for advice on best practices. I am coding against a digital camera SDK. One of the callback functions returns the large, multi megabyte images in smaller chunks. Some of the images...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
2
by: Lev | last post by:
Hi, I have some code that does reflection on an assembly I load. When I try to get the attributes on one of the methods implemented in the assembly, the MC++ version does not return anything....
7
by: Tommy Vercetti | last post by:
The first three of these statements work. The fourth doesn't. String::Format("{0}{0}{0}{0}", S""); String::Format("{0}{1}{0}{0}", S"", S""); String::Format("{0}{1}{2}{0}", S"", S"", S"");...
0
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.