C++代码里面如果加上了属性编程,生成的就是托管代码么?
如下,我在网上看到msdn的例子程序,我自己测试了一下可以编译运行的:
[export]
struct SizedValue2 {
[switch_type(char), switch_is(kind)] union {
[case(1), string]
wchar_t* wval;
[default, string]
char* val;
};
char kind;
};
[module(name="ATLFIRELib")];
int _tmain(int argc, _TCHAR* argv[])
{
SizedValue2 v;
v.kind=1;
v.wval=L"hello";
return 0;
}