1
我在C++ CLI代码:为什么C++ CLI不允许使用扩展方法?
[System::Runtime::CompilerServices::ExtensionAttribute]
public ref class MyExtensions abstract sealed {
public:
[System::Runtime::CompilerServices::ExtensionAttribute]
static System::String^ SetC() {
return gcnew System::String("{") + gcnew System::String("}") ;
}
}
但是下面一行抛出字符串没有成员国家经贸委错误。
System::String("").SetC();
我也曾尝试使用下面的代码太:
gcnew System::String("")->SetC();
是什么,错过了什么?
是的,工作正常。 – 2013-03-14 20:48:35
还有一个问题,我作为一个新的问题发布.. http://stackoverflow.com/questions/15419974/why-c-sharp-change-my-color-structure-to-valuetype – 2013-03-14 20:55:10