Ik kwam het volgende ergens tegen en wilde dit ook gaan doen in C++ Builder, maar ik kan niet de juiste code weten te vinden die hetzelfde doet binnen BCB.
void __fastcall CreateParams(TCreateParams Params);
neer moeten zetten, is dat correct?
In mijn cpp file voeg ik vervolgens het volgende toe: (correct?)
void __fastcall TForm1::CreateParams(TCreateParams Params)
{
}
Alleen wat moet ik met de functie inherited ? Deze kan ik niet vinden in BCB
Zoals ik mijn source nu heb geeft de compiler de volgende waarschuwingen:
En dat lijkt me ook niet de bedoeling..... Iemand enig idee hoe het wel moet?
Alvast bedankt...
Ik begrijp wat deze functie doet/ moet doen, maar bij alles wat ik probeer werkt het niet correct, ik denk dat ik het niet juist vertaal. Als ik het goed heb is een procedure in Delphi een void functie, dus zal ik in de private sectie van mijn header file van mijn formOverriding the CreateParams procedure
When we want to use additional parameters in the creation of the CreateParams structure we need to override the call to CreateParams procedure. (It really is confusing that both the procedure and the record type have the same name.)
In the private part of the form declaration place the next line:
...
private
procedure CreateParams
(var Params: TCreateParams); override;
...
In the implementation section place the function code:
procedure TForm.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
{code to alter the CreateParams values}
end;
The first line in the above procedure, inherited CreateParams(Params), should always be included. It is used to call the CreateParams for the TForm class and fill in the default set of parameters.
void __fastcall CreateParams(TCreateParams Params);
neer moeten zetten, is dat correct?
In mijn cpp file voeg ik vervolgens het volgende toe: (correct?)
void __fastcall TForm1::CreateParams(TCreateParams Params)
{
}
Alleen wat moet ik met de functie inherited ? Deze kan ik niet vinden in BCB
Zoals ik mijn source nu heb geeft de compiler de volgende waarschuwingen:
code:
1
2
3
| [C++ Warning] Unit1.h(59): W8022 '_fastcall TForm1::CreateParams(TCreateParams)' hides virtual function '_fastcall TCustomForm::CreateParams(TCreateParams &)' [C++ Warning] Unit1.h(59): W8022 '_fastcall TForm1::CreateParams(TCreateParams)' hides virtual function '_fastcall TScrollingWinControl::CreateParams(TCreateParams &)' [C++ Warning] Unit1.h(59): W8022 '_fastcall TForm1::CreateParams(TCreateParams)' hides virtual function '_fastcall TWinControl::CreateParams(TCreateParams &)' |
En dat lijkt me ook niet de bedoeling..... Iemand enig idee hoe het wel moet?
Alvast bedankt...