473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1243

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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
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,...

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.