从 Delphi 到 .NET 4 的转换(无需任何工具)
我们的一位客户希望将他们的 Delphi 应用程序转换为 .NET 4.0。在阅读了本网站上对各种类似问题的答复后,我决定采取逐步方法将 Delphi 代码转换为 .NET。
由于我是一名.NET开发人员,因此我需要首先熟悉Delphi。很难找到任何一个网站可以全面概述 Delphi 的概念。另外,我还没有找到任何网站提供有关 .NET 中 Delphi 等价物的信息。 例如,.NET 中“stdcall”或“export”的等效项是什么?或者 .NET 中特定的 Delphi 数据类型的等价物是什么?
有谁知道这样的在线资源,它提供了有关 .NET 中 Delphi 等效项的信息?另外如果有人可以提供任何提示吗?
One of our clients wants their Delphi application to be converted to .NET 4.0. After reading responses to various similar questions on this site, I've decided to take a step-by-step approach of converting the Delphi code to .NET.
Since I am a .NET developer, I need to first get familiar with Delphi. It is quite difficult to find any single site which provided a comprehensive overview of the concepts of Delphi. Also I haven't still found any site which provides information about the equivalents of Delphi in .NET.
For example what is the equivalent of "stdcall" or "export" in .NET? or what is the equivalent of a particular Delphi datatype in .NET?
Does anyone know about such online resource which provide information about Delphi equivalents in .NET? Also if anyone could provide any tips on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实上,最快的方法就是从头开始。尝试将遗留代码从 Deplhi 转换为 C# 充满了问题,最后,您将拥有一个类似 Delphi 的 C# 应用程序。底层框架(Delphi 中的 VCL 和 .NET 中的 FCL)具有显着的架构差异,因此考虑到转换的时间大致相当于从头开始开发的时间,您注定会成为第二类如果您沿着转换路径走下去,则可以使用该应用程序。
我还想补充一点,我已经成功地将应用程序框架从 Deplhi 转换为 Delphi.NET,以便在 Visual Studio 中使用。我这样做是为了保持两个开发环境之间的进程间通信和架构兼容性。如果这样做的好处不是很大,我绝对不会进行转换。
Really, the fastest way to do this is to start from scratch. Trying to convert the legacy code from Deplhi to C# is just fraught with issues, and at the end of it, you will have a Delphi-like C# application. The underlying frameworks, VCL in Delphi, and FCL in .NET, have significant architectural differences, so given that the amount of time to convert will be roughly equivalent to the amount of time to develop from scratch, you are dooming yourself to a 2nd class application if you go down the conversion path.
And I might add that I have successfully converted an application framework from Deplhi to Delphi.NET, for use in Visual Studio. I did this to maintain inter-process communication and architectural compatability between the two development environnments. If the benefits of this had not be large, I never would have done the conversion.
正如其他人指出的那样,没有直接的方法可以回答这个问题,除非决定全力解释 Delphi 是什么以及它与 dotNet 的比较。
不过,您可能有兴趣了解最新版本的 RadStudio 确实包含集成在 VS 中的 Delphi.NET。
这可能是您获得工作的最短、最安全的途径。
对于初学者来说,这两个版本(尽管明显不同)仍然具有足够的相似之处,可以在大部分情况下进行交叉编译 - 这肯定是一个开始。
我不确定GUI,但只要应用程序使用主流组件,就应该有dotNET对应的组件。
例如,我会想到 DevExpress 和 TMS。
最后但并非最不重要的一点是,我相信如果您需要任何具体帮助,我们都会很乐意提供帮助:)
Andrea
As others have pointed out, there is no direct way to answer this unless deciding to go all the way explaining what Delphi is and how it compares to dotNet.
You might however be interested in knowing that the latest versions of RadStudio do include a Delphi.NET which integrates in VS.
That is probably your shortest and safest path to the job.
For starters, the two versions(although remarkably different) still bear enough similarities to cross compile for the most part - and that would certainly be a start.
I am not sure about the GUI, but as long as the application is using mainstream components, there should be dotNET counterparts.
DevExpress and TMS come to mind, for instance.
Last, but not least, I am confident that if you need any specific help, we'll all be happy to help :)
Andrea
我会使用一些自动化工具来移植到 C#,只是为了减轻您移植不同语法的痛苦,之后就全是手工工作了。
还有一本针对 Delphi 开发人员的书,描述了 .NET 及其异同,.NET 2.0对于 Delphi 程序员 我知道这是另一种方式,但 IMO 可以提供帮助
I would take some of automated tools for porting to C# just to relif you the pain of porting different syntax, and after that it's all hand work.
And there is a book for Delphi developers that describes .NET and similarities and differences, .NET 2.0 for Delphi Programmers I know that this is other way around but IMO can help