English 中文(简体)
Managed class definition in C++CLI
原标题:
  • 时间:2009-11-24 03:50:52
  •  标签:
  • c++-cli

Can it be defined in .h and .cpp file or it has to be defined in a single .h file?

最佳回答

You can define in just a .h or split the class definitions just as you would for traditional C++.

Note that for properties you will need to nest your get and set methods with proper scoping, eg:

void MyModel::AProperty::set(bool b)
{
    mBackingVariableForAProperty = b;
}
问题回答

暂无回答




相关问题
Managed C++ to form a bridge between c# and C++

I m a bit rusty, actually really rusty with my C++. Haven t touched it since Freshman year of college so it s been a while. Anyway, I m doing the reverse of what most people do. Calling C# code ...

Is it difficult to port C++ to C++/CLI?

I suppose you cannot simply compile a C++ application with a C++/CLI compiler. I am wondering if it would be difficult. Has anybody tried this, and if so: were there a lot of modifications needed?

How can I use Code Contracts in a C++/CLI project?

I recently stumbled upon Code Contracts and have started using them in my C# projects. However, I also have a number of projects written in C++/CLI. For C# and VB, Code Contracts offer a handy ...

Creating 64 bit CLR C++ projects in VS2008

I am creating a wrapper around a native lib, which comes in both 32 & 64 bit flavors. I have a fairly complex C++/CLR project that includes a number of header files from the native libs. I got it ...

How to return an array of .NET objects via a COM method

I have a .NET assembly. It happens to be written in C++/CLI. I am exposing a few objects via COM. Everything is working fine, but I cannot for the life of me figure out how to return an array of my ...

in C++/CLI

When I m trying serialize a class containing this property: [NonSerialized] property System::Collections::ObjectModel::ReadOnlyCollection<String^>^ IgnoredWords I get a compilation error ...

热门标签