#using
Добавлено: 15 фев 2005, 13:41
Подскажите пожалуйста, как настроить проект Visual C++ 7 .NET, что бы он поддерживал директиву #using
/clr Restrictions
Note the following restrictions on the use of /clr:
The use of Run-time Error Checks is not valid with /clr.
When /clr is used to compile a program that does not use Managed Extensions for C++, the following guidelines apply to the use of inline assembly:
- Inline assembly code that assumes knowledge of the native stack layout, calling conventions outside of the current function, or other low-level information about the computer may fail if that knowledge is applied to the stack frame for a managed function. Functions containing inline assembly code are generated as unmanaged functions, as if they were placed in a separate module that was compiled without /clr.
- Inline assembly code in functions that pass copy-constructed function parameters is not supported.
The vprintf Functions cannot be called from a program compiled with /clr.
The naked __declspec modifier is ignored under /clr.
The use of dllexport or dllimport on classes is not permitted under /clr.
The translator function set by _set_se_translator will affect only catches in unmanaged code. See Handling Exceptions Using Managed Extensions for C++ for more information.
The comparison of function pointers is not permitted under /clr.
The use of functions that are not fully prototyped is not permitted under /clr.
The following compiler options are not supported with /clr: /GL, /Zd, /ZI or /Z7, /ML and /MLd, /Gm, /YX, and /RTC.
When using /Zi with /clr, there are performance implications; see /Zi for more information.
Passing a wide character to a .NET Framework output routine without also specifying /Zc:wchar_t or without casting the character to __wchar_t will cause the output to appear as an unsigned short int. For example:
Console::WriteLine(L' ') // will output 32
Console::WriteLine((__wchar_t)L' ') // will output a space
/GS is ignored when compiling with /clr, unless a function is under #pragma unmanaged or if the function must be compiled to native, in which case the compiler will generate warning C4793, which is off by default.
See /ENTRY for function signature requirements of a managed application.
Functions that take a variable number of arguments (varargs) will be generated as native functions. Any managed data types in the variable argument position will be marshaled to native types. Note that System::String* types are actually wide-character strings, but they are marshaled to single-byte character strings. So if a printf specifier is %S (wchar_t*), it will marshal to a %s string instead.
Ты писал?Ну а если серьёзно, то дело в том, что using без проблем работает и в 6-ой студии, и в 5-ой, мне на всех довелось поработать.