我正在处理的组件使用TCollection来保存到其他组件的链接.在设计器中编辑项目时,它们的标签看起来像这样:
0 - TComponentLink
1 - TComponentLink
2 - TComponentLink
3 - TComponentLink
Run Code Online (Sandbox Code Playgroud)
如何添加有意义的标签(可能是链接组件的名称)?例如
0 - UserList
1 - AnotherComponentName
2 - SomethingElse
3 - Whatever
Run Code Online (Sandbox Code Playgroud)
作为奖励,您能告诉我如何在双击组件时显示集合编辑器吗?
我们有一个使用RemObjects DataAbstract编写的3层Delphi应用程序.我们的许多客户都在寻求API,以便他们可以使用自己的应用程序与其进行交互.
API必须允许客户端使用各种参数调用方法,并返回从简单参数到整个数据集的结果.
您可以推荐哪些类型的API以及实施起来有多困难?
我在Delphi 2010中编写了一个服务器,需要不时地启动一个控制台应用程序来备份数据库.控制台应用程序可以将日志信息发送到控制台窗口,但不是必需的.
这在作为应用程序运行时工作正常,但是当作为服务运行时,我在启动控制台应用程序时会遇到访问冲突.即使我将其隐藏(SW_HIDE)也是如此.
是否可以从Windows服务启动隐藏的控制台应用程序?该解决方案需要在XP,Vista和Windows 7上运行.
编辑:当我调用ShellExecute时发生访问冲突.
我在Delphi Prism中编写了一个ASP.NET Web应用程序(不是站点).在我的devlopment机器上一切正常,但是当我在测试服务器上安装它时,我收到以下错误:
Server Error in '/MyApp' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: 'Oxygene' is not a supported language.
Source Error:
Line 1: <%@ Application CodeBehind="Global.asax.pas" Inherits="MyApp.Global_asax" Language="Oxygene" %>
Source File: /MyApp/global.asax Line: 1
Run Code Online (Sandbox Code Playgroud)
我已经阅读了我在网上找到的所有内容.有几篇文章提到了一个RemObjects页面(http://devcenter.remobjects.com/articles/?id={B549AFB8-04C8-4574-B185-30DE14369E66}),遗憾的是,它不再存在.
一些链接表明您可以将Language ="Oxygene"更改为Language ="C#".尝试这会产生不同的错误:
Compiler Error Message: CS1061: 'ASP.login_aspx' does not contain a definition for 'ForgottenUsernameLinkButton_Click' and …Run Code Online (Sandbox Code Playgroud) 我需要找到一种方法来识别调用类中当前函数或过程的位置.如果结果是内存位置或单元和行号,则无关紧要,只是与调用来自的位置唯一的内容.
需要快速计算位置ID,因为它将用于确定缓存数据是否可用.
例如.
type
TTestObject = class
public
procedure TestProc;
procedure TestCall;
end;
...
procedure TTestObject.TestProc;
begin
TestCall; // "Point A" - Displays "Point A"
TestCall; // "Point B" - Displays "Point B"
end;
procedure TTestObject.TestCall;
begin
ShowMessage(SomehowGetTheCallingLineLocation); // Displays "Point A" or "Point B" depending on which line above it is called from
end;
end.
Run Code Online (Sandbox Code Playgroud)
无论创建了多少TTestObject实例或它们驻留在内存中,调用TestProc时都会显示"Point A",然后显示"Point B".
该功能将用于生成SQL.目前,我将GUID传递给生成SQL的调用.如果已生成SQL,则此GUID用于从缓存中提取SQL.
NewCommand(NewUpdateCriteria('{C43D3B79-9E73-4A4B-9E29-0553542AD0B2}').
SetValue('AFIELD', AValue).
Table
('ATABLE').
Where
(NewSQLComparitor
('ID', EqualTo, AID)));
Run Code Online (Sandbox Code Playgroud)
查询调用位置需要很快,否则它会通过缓存SQL来消除我们应该看到的速度改进.
该组件最终可能成为开源,因此我无法使用任何商业第三方组件.我还想避免依赖JEDI这样的开源库.
我正在将我们的项目从XE7更新到XE8.目前他们仍然需要使用XE7,因此需要一些条件.例如,ImageList已更改单位,因此Vcl.ImgList是XE8中的Syste.ImageList.为了使它适用于两个Delphi版本,uses子句看起来像这样:
uses
System.SysUtils, System.Classes, Vcl.Controls
{$IF CompilerVersion >= 29.0}
,System.ImageList
{$else}
,Vcl.ImgList
{$endif}
,cxGraphics;
Run Code Online (Sandbox Code Playgroud)
有时这很好.但是,Delphi通常会自动重新添加System.Imagelist单元,即使它已经存在,尽管是有条件的,例如
uses
System.SysUtils, System.Classes, Vcl.Controls
{$IF CompilerVersion >= 29.0}
,System.ImageList
{$else}
,Vcl.ImgList
{$endif}
,cxGraphics, System.ImageList;
Run Code Online (Sandbox Code Playgroud)
编译时,XE8会抱怨.
[dcc32 Error] dmImagesU.pas(13): E2004 Identifier redeclared: 'System.ImageList'
Run Code Online (Sandbox Code Playgroud)
a)为什么Delphi添加单元?b)有人知道解决方法吗?
我正在调查更新我们的应用程序以使用Firebird以外的数据库服务器的可能性.我们依靠"STARTING WITH"来访问我们的分层数据.没有它,我看不出如何在没有经过一些严肃的重新设计的情况下迁移到另一个数据库.
如果您不熟悉"STARTS WITH",它只是检查字符串字段是否以特定字符串开头,例如......
WHERE 'This is a test' STARTS WITH 'This is' ...
Run Code Online (Sandbox Code Playgroud)
会回归真实.如果列已建立索引,则索引将用于比较.
其他数据库服务器(尤其是Oracle/MSSQL)是否支持"STARTING WITH"(或"STARTS WITH")?
我正在尝试使用GDI绘制多边形.此代码有效:
type
TPolygon: Array[0..2] of TPoint;
var
ACanvas: TGPGraphics;
MyBrush: TGPLinearGradientBrush;
...
procedure DrawPolygon;
var
Polygon: TPolygon;
begin
Polygon[0].X := 1;
Polygon[0].Y := 5;
Polygon[1].X := 10;
Polygon[1].Y := 15;
Polygon[2].X := 1;
Polygon[2].Y := 5;
ACanvas.FillPolygon(MyBrush, PGPPoint(@Polygon), length(Polygon));
end;
...
Run Code Online (Sandbox Code Playgroud)
此代码生成GDI值溢出错误:
type
TPolygon: Array of TPoint;
var
ACanvas: TGPGraphics;
MyBrush: TGPLinearGradientBrush;
...
procedure DrawPolygon;
var
Polygon: TPolygon;
begin
SetLength(Polygon, 3);
Polygon[0].X := 1;
Polygon[0].Y := 5;
Polygon[1].X := 10;
Polygon[1].Y := 15;
Polygon[2].X := 1;
Polygon[2].Y := …Run Code Online (Sandbox Code Playgroud) delphi ×7
delphi-xe7 ×2
.net ×1
api ×1
arrays ×1
asp.net ×1
database ×1
delphi-2009 ×1
delphi-2010 ×1
delphi-prism ×1
delphi-xe2 ×1
delphi-xe8 ×1
firebird ×1
gdi+ ×1
oracle ×1
remobjects ×1
sdk ×1
service ×1
uses-clause ×1
windows-7 ×1