15

A rather comprehensive site explaining the difficulties and solutions involved in using a dll written in c/c++ and the conversion of the .h header file to delphi/pascal was posted to a mailing list I was on recently, so I thought I'd share it, and invite others to post other useful resources for this, whether they be links, conversion tools, or book/paper titles.

One resource per answer please, so we'll end up with the most popular/best resources bubbling to the top.

4

7 回答 7

16

Over at Rudy's Delphi Corner, he has an excellent article about the pitfalls of converting C/C++ to Delphi. In my opinion, this is essential information when attempting this task. Here is the description:

This article is meant for everyone who needs to translate C/C++ headers to Delphi. I want to share some of the pitfalls you can encounter when converting from C or C++. This article is not a tutorial, just a discussion of frequently encountered problem cases. It is meant for the beginner as well as for the more experienced translator of C and C++.

He also wrote a "Conversion Helper Package" that installs into the Delphi IDE which aids in converting C/C++ code to Delphi:

alt text
(source: rvelthuis.de)

His other relevant articles on this topic include:

于 2009-11-01T14:38:43.680 回答
6

Article at Rudy's Delphi Corner

于 2008-09-19T08:57:34.103 回答
2

Also, CodeGear hosts a rudimentary translation tool called CToPas (written by Ural Gunaydin).

于 2008-09-19T09:48:45.137 回答
2

I would like to highlight the Jedi Api Library, it is the Delphi translation of the Windows SDK headers. Might save you a lot of work if you need to translate headers from the SDK and is of course a good sample of conversions!

于 2009-10-31T19:22:55.107 回答
2

Since FreePascal is aimed at Delphi compatibiltiy among other things, i think H2Pas may be helpful too.

https://www.freepascal.org/tools/h2pas.var

于 2012-09-26T08:06:46.913 回答
1

HeadConv from DrBob is used quite a lot too, although I concur with Graza that manual translation is best.

于 2008-09-19T09:45:10.510 回答
1

use this option so the byte alignment is the same as C/C++ and then you don't need to add padding bytes in structs.

{$MINENUMSIZE 4}

于 2008-09-19T18:54:31.587 回答