編譯器錯誤 C3386
'type-name' :
__declspec(dllexport)
/__declspec(dllimport)
無法套用至受控或 WinRT 類別
dllimport
和 dllexport
__declspec
修飾元不適用於受控或 Windows 執行階段類型。
下列範例會產生 C3386,並示範如何修正此問題:
// C3386.cpp
// compile with: /clr /c
ref class __declspec(dllimport) X1 { // C3386
// try the following line instead
// ref class X1 {
};