PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Reason
  • Correction
  • Example
  • Passing parameters to a constructor
Products
WINDEVWEBDEV - Server codeWEBDEV - Browser codeWINDEV MobileReports and Queries
Platforms
WindowsLinuxWindows MobileUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadApple Watch
Languages
JavaPHPAjaxUser code (UMC)External language
Databases
HFSQLHFSQL Client/ServerStored proceduresOLE DBODBCNative Accesses
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 version required
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment