編譯器錯誤 C2505
'symbol' : '__declspec(modifer)' 只能套用至全域物件或靜態資料成員的宣告或定義
函式中使用了設計為只能用於全域範圍的 __declspec 修飾詞。
如需詳細資訊,請參閱 appdomain 和 process。
下列範例會產生 C2505:
// C2505.cpp
// compile with: /clr
// OK
__declspec(process) int ii;
__declspec(appdomain) int jj;
int main() {
__declspec(process) int i; // C2505
__declspec(appdomain) int j; // C2505
}