Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'object type': placement arguments not allowed while creating instances of managed or WinRTclasses
Remarks
When creating an object of a managed type or Windows Runtime type, you cannot use the placement form of operator ref new, gcnew or new.
Example
The following example generates C3828 and shows how to fix it:
// C3828a.cpp
// compile with: /clr
ref struct M {
};
ref struct N {
static array<char>^ bytes = gcnew array<char>(256);
};
int main() {
M ^m1 = new (&N::bytes) M(); // C3828
// The following line fixes the error.
// M ^m1 = gcnew M();
}