C++ to Delphi guide lines is there any?

Like title says is there any online resources that give you guide lines or help converting c++ to pascal(delphi) I have seen loads of converters for delphi to c++ but none for the other way around.

Thanks.

Yours
Simon Lewis
AFAIK there aren't many -- and not of any real quality.

Going from C++ to Delphi is relatively straight-forward, but you must be aware of one significant issue: the object model is very different.

In Delphi, all objects are instantiated on the heap, explicitly. And you must watch its lifetime carefully.

1
2
3
4
5
6
7
8
9
10
11
var
  foo: TSomething;

begin
  foo := TSomething.Create( argument, ... );
  try
    ...
  finally
    foo.Free
  end
end;

The best thing you can do is study up on the Delphi object model.

The latest versions of Delphi also have generics crufted in, so if your C++ project uses them you might want to read up on how generics work in Delphi as well. (My personal opinion is that they did it wrong... but I'm not the one who designed it... It is very similar to C++'s generics.)

Keep in mind that C++ idioms will not translate directly to Delphi idioms. Look around the net for how to do something using general terms -- often there is a class that will help you do exactly what you want, just a different way than you would in C++.

Hope this helps.
thanks for the advice :)
Topic archived. No new replies allowed.