Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
method 'method' of class 'class' defines unsupported default parameter 'parameter'
Remarks
The compiler detected a method with one or more parameters with default values. The default value(s) for the parameters will be ignored when the method is invoked; explicitly specify values for those parameters. If you do not explicitly specify values for those parameters, the C++ compiler will generate an error.
Example
Given the following .dll created with Visual Basic, which allows default parameters on method arguments:
' C4564.vb
' compile with: vbc /t:library C4564.vb
Public class TestClass
Public Sub MyMethod (a as Integer, _
Optional c as Integer=1)
End Sub
End class
And the following C++ example that uses the .dll created with Visual Basic,
// C4564.cpp
// compile with: /clr /W4 /WX
#using <C4564.dll>
int main() {
TestClass ^ myx = gcnew TestClass(); // C4564
myx->MyMethod(9);
// try the following line instead, to avoid an error
// myx->MyMethod(9, 1);
}