Kbase P185055: Error 12905 when passing THIS-OBJECT as a parameter
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  01/04/2011 |
|
Status: Unverified
SYMPTOM(s):
Error 12905 when passing THIS-OBJECT as a parameter
Parameter for is not type compatible with its definition. (12905)
FACT(s) (Environment):
Class is defined as Form (unqualified).
In the USING statements
USING System.Windows.Forms.* FROM ASSEMBLY.
appears before
USING Progress.Windows.* FROM ASSEMBLY.
Windows
OpenEdge 10.2x
CAUSE:
Because the only namespaces referenced in USING statements that contain a Form class are System.Windows.Forms.* and Progress.Windows.*, and because System.Windows.Forms.* appears first, the class is defined as System.Windows.Forms.Form instead of Progress.Windows.Form. When THIS-OBJECT is passed as parameter later in the code, compile error 12905 is raised because the method being called is expecting Progress.Windows.Form for that parameter.
FIX:
Error 12905 can be avoided in any of the following ways:
Fully qualify Progress.Windows.Form in the class definition.
Add the statement:
USING Progress.Windows.Form FROM ASSEMBLY.
This will force the compiler to interpret Form as Progress.Windows.Form.
Reference Progress.Windows.* before System.Windows.Forms.* in the list of USING statements.