नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : cannot catch a native type with __clrcall destructor or copy constructor
Remarks
A module compiled with /clr attempted to catch an exception of native type and where the type's destructor or copy constructor uses __clrcall calling convention.
When compiled with /clr, exception handling expects the member functions in a native type to be __cdecl and not __clrcall. Native types with member functions using __clrcall calling convention cannot be caught in a module compiled with /clr.
For more information, see /clr (Common Language Runtime Compilation).
Example
The following example generates C2743.
// C2743.cpp
// compile with: /clr
public struct S {
__clrcall ~S() {}
};
public struct T {
~T() {}
};
int main() {
try {}
catch(S) {} // C2743
// try the following line instead
// catch(T) {}
try {}
catch(S*) {} // OK
}