Home > Back-end >  When calling a function cannot be compiled
When calling a function cannot be compiled

Time:10-02

Just from the Delphi to learn c + + Builder
Test the function cannot compile
String SoFind (TFindOptions * Options, THandle * Hde)
{
//function
}

Void __fastcall TForm1: : FormClick (TObject * Sender)//call cannot compile
}
SoFind (FindDialog1 - & gt; The Options, Form1 - & gt; Handle);
}

//don't know what to write the wrong there

CodePudding user response:

Resolutely eliminate 0 reply

The error message, just below the window appears at compile time the

CodePudding user response:

//call cannot compile
This general information, without any reference value, moreover is the compile time period or link problems, also not necessarily, ask questions later, suggest stick detailed error information, if you want to be lazy, pass even cut a figure,

CodePudding user response:

Void __fastcall TForm1: : FormClick (TObject * Sender)//call cannot compile
//} //
{
SoFind (FindDialog1 - & gt; The Options, Form1 - & gt; Handle);
}

CodePudding user response:

Estimation is String SoFind (TFindOptions * Options, THandle * Hde) this function is not in the class of TForm1 statement, so can't access the FindDialog1, Form1

CodePudding user response:

FindDialog1 - & gt; Options are object rather than a pointer, and your String SoFind (TFindOptions * Options, THandle * Hde) is defined in a pointer, so called to pass a pointer past: SoFind (& amp; (FindDialog1 - & gt; The Options), Form1 - & gt; Handle);
Usually get into the habit of the object using a reference can this happen, and less like the above function is defined as:
String SoFind (TFindOptions & amp; Options, THandle * Hde), can be directly preach object:
SoFind (FindDialog1 - & gt; The Options, Form1 - & gt; Handle);
  • Related