当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: There are lots of resources and
 

 

    摘要: 之前用的是java那一套东西,有eclipse什么都搞定了。现在因为要用delphi改一个即时通讯软件的缘故,想着怎么能把重构和单元测试那一套搬到delphi这边来。书上说给现有的代码加单元测试能够加深对代码的理解,并且可以作为改善代码的基础,这不正是我要做的事情吗?于是,为了搭建这么一个敏捷平台,我以delphi2005和dunit进行了一点小小的尝试,并把结果记录于下,与大家分享。   1、......
    摘要: tstream 使用了下面的代码,强制子类必须implement两个seek方法中至少一个 classes.pas 单元4904行@delphi7 首先说明tstream有两个seek方法 function seek(offset: longint; origin: word): longint; overload; virtual; //叫它seek1function seek(cons......


Creating Forms that are stored in DLLs

there are lots of resources and solutions out there on the internet that are specific to this problem, however, in using the businessskinform components, that are tightly integrated with the vcl and messaging, i came across a few problems with the standard approaches.

the main problem with storing forms in dlls and being able to create instances of them from within a host exe is that when delphi compiles up a dll, it has its own tapplication and tscreen instances (as well as other info as to be discovered). 【程序编程相关:systemparametersinfo

the final solution came with the assistance of steve woods (aka reconics). 【推荐阅读:ShadowStar CodeFast

so how do we coax the form in the dll to think it is part of the exe, we replace the application and screen object in the dll with the reference to the exes application and screen. 【扩展信息:试卷自动生成系统的开发与应用

this means that the dll and the exe message loops are different, the rtti information is different, and causes lots of problems like the well know "cannot assign a tfont to a tfont" message.

this is a standard approach that you will find on the net. however there is one additional element that needs to be passed from exe to dll and this is the tricky one.

from steve woods -

“the problem is caused by the controlatom local variable in the controls.pas units. when the controls unit initializes it creates a global atom based on the string controlofs + the hinstance and thread id of the application and stores the atom in the controlatom local variable.


...   下一页
    摘要:  < 想法 >  软件的“换肤”技术早已不是什么新鲜事了,但细心的朋友一定已经发现了,现在正悄悄地流行了一种新的改善视觉效果的方法——这里我斗胆定义为“换肤色”技术吧!用过winamp 5、windows mediaplay 9、msn messenger 6、qq2004这些新版本软件了吧,呵呵,全都采用了所谓换汤不换药的“换肤色”技术。挺有意思是吧,下面我们就“自己动手,丰衣足食......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE