存档

‘2.Delphi’ 分类的存档

Migrating Existing Delphi Applications to Unicode-enabled Delphi

2010年1月10日 Admin 没有评论

Over the life of an application it is often necessary or desirable to migrate the application to a newer version of the development environment. By doing so, the application can take advantage of a more modern interface, improvements in performance or memory management, as well as new or improved features.

It comes as no surprise, therefore, that there are many Delphi applications that have been converted, upgraded, and migrated through two or more versions of Delphi.

There is one migration, however, that stands out from the rest. That is the migration of a native code application written in Delphi 2007 or earlier to the latest version. What makes this one so different is that a number of the fundamental data types, types that have been around since the Delphi 1 and Delphi 2 days, have changed. I am talking about String, Char, and PChar, and I am referring to their support for Unicode.

In late 2009, Michael Rozlog, Senior Directory of Delphi Solutions, contacted me to see if I was interested in writing a white paper about migrating Delphi applications to Unicode-enabled Delphi. Ironically, I was in the midst of writing training material about what Unicode support meant for application development. And, I was keenly aware that a Unicode migration white paper, if it was to be effective, needed to rely on much more than just my personal experience. This really was a job for the greater RAD Studio community.

Here was my thinking. Delphi 2009 had been out for almost a year and a half, and Delphi 2010 had shipped three months earlier. As a result, many developers had been through the process of migrating existing applications to the Unicode enabled versions. And, if there was some way of collecting their stories, a clear picture of the migration process would emerge.

The call for stories, code samples, and advice on Unicode migration went out using blogs, tweets, the Embarcadero Developer Network, and some gentle personal prodding of various Delphi experts. And during 6 weeks in October of November I was fortunate enough receive a lot of input. In all, more than 20 contributors provided material, sometimes with a single, valuable code sample, and in other cases, with extensive narratives describing the preparation, process, and techniques used to migrate their applications.

And what a group of contributors this was. A number of them are the innovators behind some of the most popular third-party tools available to Delphi Developers. I also received input from well-known authors, trainers, bloggers, and authorities in the Delphi community. Everyone had something valuable to say, and it all contributed nicely to the paper.

This material is now available in the white paper Delphi Unicode Migration for Mere Mortals: Stories and Advice from the Front Lines. This paper begins with a brief overview of some of the technical aspects of Delphi’s Unicode support. It then addresses specific areas of application development that may be affected by the changes to Delphi’s default string types.

Throughout the paper you will find direct quotes from the contributors, and in most cases you will also find code samples that reflect the kind of changes that you may have to make to your code as you upgrade existing applications (as well as possible changes to some of the core techniques you are accustom to using). I tried hard to give credit where credit was due, as I strongly feel that a paper of this scope and breadth would be nearly impossible were it not for the generous contributions of the contributors.

To everyone who contributed material, and especially to those brave individuals who agreed to review the paper for technical accuracy, thank you.

If you are preparing to migrate an existing application to Delphi 2010 (or Delphi 2009), or are in the midst of your own migration, you will hopefully find a lot of valuable information in this white paper. I do have one request, however. When you are ready to read the white paper, please download it right before reading. I hope to update this paper sometime in the future with additional material, if it makes sense to do so. In fact, the version of this paper that out there at the time of this writing (January 9th, 2010) includes two corrections that were reported by readers. If you downloaded the PDF prior to January 8th, you have the older version. Get the newer version.

One final note. If you also have stories, advise, or code samples that are not reflected in the current version of the white paper, and would like to have your material considered for a future revision, please do not hesitate to send it to me. I cannot promise that new contributions will actually appear in the paper (there was some nice material that didn’t fit into this version), but I would like to consider it.

点这里下载:Migrating Existing Delphi Applications to Unicode-enabled Delphi

分类: 2.Delphi 标签:

Utilities that come with Free Pascal 之 h2pas系列

2009年12月22日 Admin 1 条评论

偶然从freepascal的官网上下载了本手册。阅读到了本章节一直比较关注的问题,这里做个小小的笔记,以备查阅。

想学pcre呢,用CMake和MingW编译后,可用的lib和dll是有了,但问题是没有“头文件”。

缺那个呢?pcre.h要转成pas的申明,还是有相当难度的。

看见了h2pas工具后,这一切就变的简单了,呵呵。

什么,你急着用h2pas pcre.h?那么,嘿嘿,恭喜你,一堆错误。

一定是这个工具有问题吧?我一开始也是这么想的。

直到我发现h2paspp后,这个工具是先把头文件的预处理指令给处理了,您在用h2pas试试?

怎么样,成功了吧。呵呵~不过这只是转成功了,能不能用,还要在看了。

分类: 2.Delphi 标签: , ,

Embarcadero已收回Delphi2010 update2/3

2009年11月14日 Admin 没有评论

由于Delphi2010 的update 2/3有注册上的bug,正版用户注册后依然每次弹出注册窗口
对用户的体验造成巨大的负面影响,因此Embarcadero收回了已发布的update 2/3

收回更新包的做法在Delphi的历史上还是第一次发生,现在已经无法在reg页面下载到更新了
当然了,这对已经升过级并且用了破解补丁的用户来说,完全没有影响

原文地址:

http://blogs.embarcadero.com/nickhodges/2009/11/13/39332

分类: 2.Delphi 标签: ,

Borland总算被收购了

2009年11月14日 Admin 没有评论

Borland总算被收购了。
一个传奇从此消失。

分类: 2.Delphi 标签:

WinAMP 插件数据结构C语言版

2009年10月21日 Admin 没有评论

存档以备后用。

1
2
3
4
5
6
7
8
9
typedef struct {
  int version;                   // version of the plugin structure
  char *description;             // name/title of the plugin 
  int (*init)();                 // function which will be executed on init event
  void (*config)();              // function which will be executed on config event
  void (*quit)();                // function which will be executed on quit event
  HWND hwndParent;               // hwnd of the Winamp client main window (stored by Winamp when dll is loaded)
  HINSTANCE hDllInstance;        // hinstance of this plugin DLL. (stored by Winamp when dll is loaded) 
} winampGeneralPurposePlugin;
分类: 2.Delphi 标签: , ,

让你的应用程序在每个Windows 会话中只执行一次

2009年10月9日 Admin 1 条评论

让你的应用程序在每个Windows 会话中只执行一次。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
uses
 Windows,
 Forms,
 mainUnit in 'mainUnit.pas' {FormMain};
 
 {$R *.res}
 
begin
 Application.Initialize;
 
 if 0 = GlobalFindAtom('SOME-UNIQUE-TEXT-RELATED-TO-THIS-APPLICATION') then
 begin
 GlobalAddAtom('SOME-UNIQUE-TEXT-RELATED-TO-THIS-APPLICATION') ;
 
 Application.CreateForm(TFormMain, FormMain) ;
 Application.Run;
 end
 else
 begin
 Application.MessageBox(
 'You can run the trial version '+
 'of this application '+
 'only once per Windows session!',
 'Test Trial Protection') ;
 end;
 end.
分类: 2.Delphi 标签:

Test your Lazarus/FPC code with FPCUnit

2009年10月7日 Admin 没有评论

用FPCUnit测试你的Lazarus/FPC代码,很棒的小册子,转载的,提供下载。

点我下载

分类: 2.Delphi 标签: ,