Thread View: borland.public.cppbuilder.migration
3 messages
3 total messages
Started by CN
Wed, 15 Dec 2004 08:56
Delphi to BCB help needed
Author: CN
Date: Wed, 15 Dec 2004 08:56
Date: Wed, 15 Dec 2004 08:56
118 lines
3833 bytes
3833 bytes
Hi!
I have been trying to translate the GSC QB Delphi code (from
http://www.gsc.hu). I thought it was merely a task of syntax translation.
Having found its complexity, I am about to abort the whole job after 30
hours' work. Before making the painful decision, hopefully someone can
help solving the following issues so that I can luckly finish it.
Thank you very very much!
CN
---Problem 1---
Delphi:
WndProc(var Message: TMessage);
begin
with TWMKey(Message) do //The BCB equivalence?
DoDropDownKeys(CharCode, KeyDataToShiftState(KeyData)); //The BCB
equivalence?
//do more stuff
end;
What are the equivalent BCB statements for these two Delphi statements?
with TWMKey(Message) do
DoDropDownKeys(CharCode, KeyDataToShiftState(KeyData));
---Problem 2---
Delphi:
procedure TGSCQBTable.WMMove(var Message: TWMMove);
begin
inherited;
//do more stuff
end;
where TGSCQBTable inherites from TForm.
void __fastcall TGSCQBTable::WMMove(TWMMove &Message)
{ TForm::WMMove(Message); //compiler complains:
//TWinControl::WMMove(TWMMove &) is not accessible
}
The workaround?
---Problem 3---
Delphi:
procedure TGSCQBInplaceEdit.DropDown;
begin
FPickList.Color := Color;
FPickList.Font := Font;
FPickList.Height := ...;
Windows.SetFocus(Handle);
end;
TGSCQBInplaceEdit inherites from TInplaceEdit.
FPickList inherites from TCustomListBox.
BCB:
void __fastcall TGSCQBInplaceEdit::DropDown(void)
{ FPickList->Color=...; //Compiler complains: 'TControl::Color' is not
accessible
//Same access problem at these properties or event:
FPickList->Font=...
FPickList->Height=...
FPickList->IntegralHeight=...
FPickList->ItemHeight=...
FPickList->OnMouseUp=... //an event
}
Help needed:
(1) Any solution for above properties/event access problem?
(2) What is the equivalent statement to the following Delphi? What is
"Windows"?
Windows.SetFocus(Handle);
---Problem 3---
Delphi:
procedure TGSCQBInplaceEdit.WMCancelMode(var Message: TMessage);
begin
StopTracking;
inherited;
end;
void __fastcall TGSCQBInplaceEdit::WMCancelMode(TMessage &Message)
{
TInplaceEdit::WMCancelMode(Message);
//'_fastcall TControl::WMCancelMode(TWMNoParams &)' is not accessible
}
Same problem happens to these
TInplaceEdit::WMKillFocus(Message);
TInplaceEdit::WMLButtonDblClk(Message);
---Problem 4---
Delphi:
procedure TPopupListbox.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
WindowClass.Style := CS_SAVEBITS;
end;
BCB:
void __fastcall TPopupListbox::CreateParams(TCreateParams &Params)
{ inherited::CreateParams(Params);
Params.WindowClass.Style=CS_SAVEBITS; //How to fix compiler error:
//'Style' is not a member of 'tagWNDCLASSA'
}
Re: Delphi to BCB help needed
Author: CN
Date: Thu, 16 Dec 2004 03:55
Date: Thu, 16 Dec 2004 03:55
10 lines
1179 bytes
1179 bytes
> WndProc(var Message: TMessage); > begin > with TWMKey(Message) doend; After reading the help and comparing TWMKey and TMessage, I think Delphi casts TMessage structure to TWMKey structure. Thanks! CN
Re: Delphi to BCB help needed
Author: CN
Date: Thu, 16 Dec 2004 11:59
Date: Thu, 16 Dec 2004 11:59
6 lines
1131 bytes
1131 bytes
With the help from people in cppbuilder.vcl.using newsgroup, all the other issues have been solved, too. Thank you for your time! Regards, CN
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads