AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Errores / Errores WLanguage
  • Reason
  • Correction
  • Example
  • Passing parameters to a constructor
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Error 1046: Wrong parameter for the constructor of the class
Reason
You are trying to define an object of a class. The number of parameters does not correspond to the number of parameters expected by the class.
Correction
Check the parameters expected by the constructor of the class and modify your code.
Example

Passing parameters to a constructor

Code triggering the error
// -- Click code on BTN_CreateCircle
pDrawing is Circle dynamic = new Circle(gpDrawing, x, y, width)
// -- Constructor of "Circle" class
PROCEDURE Circle::Constructor(pt, aa, bb, cc, dd)
Possible correction
Pass the expected number of parameters.
// -- Click code on BTN_CreateCircle
pDrawing is Circle dynamic = new Circle(gpDrawing, x, y, width, height)
 
// -- Constructor of "Circle" class
PROCEDURE Circle::Constructor(pt, aa, bb, cc, dd)
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 26/05/2022

Señalar un error o enviar una sugerencia | Ayuda local