Re: Convert C-Builder program to Delphi?
From: W. D. (NewsGroups_at_US-Webmasters.com)
Date: 01/03/05
- Next message: Bonj: "Re: Standard network method"
- Previous message: Jonathan Turkanis: "Re: Template ctor - explicitly specify templ param"
- Next in thread: Maarten Wiltink: "Re: Convert C-Builder program to Delphi?"
- Reply: Maarten Wiltink: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 03 Jan 2005 02:51:07 -0600
Thanks everyone for your help on this problem! I really do
appreciate the thought and time you put into your answers to
my questions.
After quite a few attempts at adding the forms, I found
that the easiest way to do it is to open up both C-Builder
and Delphi to the "Project Manager". This is done by
mousing to: View -> Project Manager (Shortcut: Ctrl-Alt-F11).
Once this window is open in both environments, try to make
the Delphi project structure look exactly like the C-Builder
structure.
For each .pas file, just put together a very short, syntactically
correct file like Walter suggested:
=================================================================
unit Unit1;
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls;
interface
type
TForm1 = class(TForm)
end;
implementation
{$R *.dfm}
end.
=================================================================
Highlight the proper place in the Project Manager, then mouse to:
Project -> Add to Project (Shortcut: Shift-F11). This will
add the .pas file in the proper place relative to all the other
elements. Once the .pas file is added, add the form (.dfm) right
next to it. When these forms are added, the event handlers
are forced to be discarded.
After having done this, I now have a structure that looks
very much like the C-Builder program, and the forms in
the Delphi project are exactly the same.
However, I am running into rough territory translating the
code. (As I mentioned before, both my Delphi and C coding
skills are quite rusty--although it is coming back to me
fairly quickly.)
I've been trying to incorporate the .h files into the
Interface section of one unit. Ralph's suggestion
of putting the C++ code into a comment just before
the Delphi translation helps to understand things more
clearly. This is a medium sized program, so I've
resorted to writing some regular expressions in order
to convert much of the simpler code.
However, I can't seem to find the proper way to
translate some entries in the .h file. Does anyone
have some idea what might be appropriate?
#1:
--------------------------------------------------------
extern TMainForm *MainForm;
--------------------------------------------------------
#2:
--------------------------------------------------------
typedef struct
{
BYTE header[8];
BYTE *data;
DWORD size;
}
DATA_STORE;
--------------------------------------------------------
#3:
--------------------------------------------------------
extern int MAX_STORED_UNITS;
--------------------------------------------------------
#4:
--------------------------------------------------------
extern THE_BUFFER *buffer;
--------------------------------------------------------
#5:
--------------------------------------------------------
extern DWORD req_data;
--------------------------------------------------------
Again, I really appreciate any shoves in the proper
direction on all this. I've been digging through Google
and GoogleGroups for much of this, but there's not a lot
out there.
- Next message: Bonj: "Re: Standard network method"
- Previous message: Jonathan Turkanis: "Re: Template ctor - explicitly specify templ param"
- Next in thread: Maarten Wiltink: "Re: Convert C-Builder program to Delphi?"
- Reply: Maarten Wiltink: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Maybe reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|