ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • 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)
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help