PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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)
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment