小编The*_*Fox的帖子

如何从表单单元外部访问delphi控件?

我试图调用一个计时器从这样的定义的过程Enabled属性:procedure Slide(Form: TForm; Show: Boolean);而不是有固定的形式名称(如:Form2.Timer...)

将表单的单位放入使用列表后,这可以工作:Form2.Timer1.Enabled := True; 但以下操作无效:( Form.Timer1.Enabled := True;其中Form是作为参数传递给过程的表单.

如何访问表单上的Timer组件?

提前致谢.

delphi pascal

3
推荐指数
1
解决办法
7701
查看次数

使用Aero获取TProgressBar控件的颜色

如何以编程方式获取启用Windows Aero功能的TProgressBar控件的条形颜色和背景颜色?

我正在使用第三方进度条控件,而不是Delphi附带的默认控件,我正在尝试使用正确的颜色绘制控件.

我使用的是Delphi 2010.

delphi colors aero windows-7 progress-bar

3
推荐指数
1
解决办法
708
查看次数

为什么我的IMessageFilter并不总是有效?

我正在进行Word自动化并摆脱"被调用被拒绝的呼叫"/"消息过滤器指示应用程序正忙"错误我实现了IMessageFilter.当我直接自动化Word时,messagefilter就像魅力一样:

Word.Documents.Open(...)
Document.SaveAs(...)
Run Code Online (Sandbox Code Playgroud)

但是当我调用TOleContainer.DoVerb(ovPrimary)时,我仍然会在Word显示模式对话框时出错.为什么MessageFilter不能与TOleContainers DoVerb方法一起使用?

delphi automation ole ms-word imessagefilter

2
推荐指数
1
解决办法
1740
查看次数

德尔福:对于布尔值,XOR vs <>

之间有什么区别:

procedure InequalityMsg(ABool1, ABool2 : Boolean);
begin
  if ABool1 <> ABool2 then
    ShowMessage('Yeah, they''re not the same');
end;
Run Code Online (Sandbox Code Playgroud)

procedure InequalityMsg(ABool1, ABool2 : Boolean);
begin
  if ABool1 XOR ABool2 then
    ShowMessage('Yeah, they''re not the same');
end;
Run Code Online (Sandbox Code Playgroud)

delphi inequality boolean xor

2
推荐指数
1
解决办法
1794
查看次数

如何在Delphi选项对话框中添加我自己的项目

如何将自己的项目添加到Delphi选项对话框(工具\选项)?例如,请参阅Project JEDI选项.

Delphi选项对话框中的Project JEDI项目的屏幕截图

例如,对我来说,有一个我的书签,包括我的组件和新项目的编译选项.例如,有一个新的项目,在它的面板和3上面的复选框如何添加?

delphi delphi-xe2

2
推荐指数
1
解决办法
376
查看次数

如何将ISO 639-1代码转换为语言ID

有没有办法使用Windows API从语言ISO代码中获取主要语言ID?我想将它用于我的GetDateFormatInt函数,我很好奇是否有一种不使用常量的方法.虽然该函数不使用英语的默认子语言,但我只对主语言ID感兴趣.

function GetDateFormatInt(const aLanguageISOCode: string): string;
const
  C_ISO_CODES: array[0..3] of string = (
    'nl', 'en', 'de', 'fr'
  );
  C_LCIDS: array[0..3] of Cardinal = (
    ((SUBLANG_DUTCH shl 10) or LANG_DUTCH) or (SORT_DEFAULT shl 16),
    ((SUBLANG_ENGLISH_UK shl 10) or LANG_ENGLISH) or (SORT_DEFAULT shl 16),
    ((SUBLANG_GERMAN shl 10) or LANG_GERMAN) or (SORT_DEFAULT shl 16),
    ((SUBLANG_FRENCH shl 10) or LANG_FRENCH) or (SORT_DEFAULT shl 16)
  );
var
  i: Integer;
  lLCID: Cardinal;
  lBuffer: array[0..512] of Char;
begin
  i := AnsiIndexText(aLanguageISOCode, C_ISO_CODES);
  if i > -1 …
Run Code Online (Sandbox Code Playgroud)

delphi winapi localization

1
推荐指数
1
解决办法
1824
查看次数

Delphi XE2:为Win64平台转换ASM方法

当我尝试为Win64平台编译pascal单元时,遇到错误.这些方法包含ASM块.我不知道如何让它适用于Win64平台:

方法1:

Function TSparseList.ForAll( ApplyFunction: Pointer {TSPAApply} ): Integer; Assembler;
Asm
        MOV     EAX,[EAX].TSparseList.FList
        JMP     TSparsePointerArray.ForAll
End;
Run Code Online (Sandbox Code Playgroud)

方法2:

Function TSparsePointerArray.ForAll( ApplyFunction: Pointer {TSPAApply} ):
  Integer;
Var
  itemP: PAnsiChar; { Pointer to item in section } { patched by ccy }
  item: Pointer;
  i, callerBP: Cardinal;
  j, index: Integer;
Begin
  { Scan section directory and scan each section that exists,
    calling the apply function for each non-nil item.
    The apply function must be a far local function in the scope of
    the …
Run Code Online (Sandbox Code Playgroud)

delphi win64 delphi-xe2

1
推荐指数
2
解决办法
2337
查看次数

Tomcat无法启动

137.57.1​​02.146处的服务器Tomcat v7.0服务器无法在45秒内启动.如果服务器需要更多时间,请尝试在服务器编辑器中增加超时.

这是我的控制台

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-137.57.102.153-8080"]
java.net.BindException: Cannot assign requested address: JVM_Bind /137.57.102.153:8080
    at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:391)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:554)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:409)
    at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:781)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:595)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:620)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
Caused by: java.net.BindException: Cannot assign requested address: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:96)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:55) …
Run Code Online (Sandbox Code Playgroud)

tomcat

1
推荐指数
1
解决办法
2万
查看次数

使用DOM Delphi 7访问冲突错误

我正在构建一个软件来处理网站上的订单.我正在使用DOM浏览网站,当我在"错误"页面上使用命令时,我希望我的应用程序不会挂起.

例如:

try
  WebBrowser.OleObject.Document.GetElementByID('ContentPlaceHolder1_txtCommande').setAttribute('value', lblDate.Caption);
except
end;
Run Code Online (Sandbox Code Playgroud)

我想要的只是在找不到该字段时忽略该错误,因为此错误并不重要.谢谢!

编辑:当我的意思是DOM时写了ADO

delphi dom

1
推荐指数
1
解决办法
741
查看次数

显示Delphi和C++源代码

如何查看Delphi或C++编译的可执行文件的源代码?

请帮我.

编辑后:

我有一个程序.当我启动该程序时,它会显示一个对话框并要求输入密码.此密码保存在源代码中.我想快速轻松地获取此密码.

c++ delphi decompiling

0
推荐指数
1
解决办法
2168
查看次数

如何在Delphi XE中打开和编译Delphi 5项目?

是否有IDE可以打开传统的Delphi 5项目?
Delphi XE似乎不支持delphi 5.

delphi delphi-5 delphi-xe

0
推荐指数
2
解决办法
4326
查看次数

XML和Delphi问题

我正在尝试实现一个协议,我将用于我的应用程序与服务器进行通信.问题是服务器正在使用XML,所以我尝试将字符串发送到包含xml的服务器,但我只得到错误.

当我寄这个:

mymsg: String = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
'<m:outgoingEngineMessage xmlns:c="http://www.bvb.ro/xml/ns/arena/gw/constraints"'+
'xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg"'+
'xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;'+
'&lt;content xsi:type=&quot;HeartBeatcmd&quot;&gt;'+
'&lt;/content&gt;'+
'&lt;csq&gt;100212&lt;/csq&gt;'+
'&lt;/m:outgoingEngineMessage&gt;';
Run Code Online (Sandbox Code Playgroud)

我收到一条错误说:

元素类型"m:outgoingEngineMessage"必须后跟属性规范,">" 或"/>"

当我寄这个:

mymsg : String = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
    '&lt;m:outgoingEngineMessage xmlns:c=&quot;http://www.bvb.ro/xml/ns/arena/gw/constraints"'+
    'xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg"'+
    'xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;'+
    '&lt;content xsi:type=&quot;HeartBeatcmd&quot;&gt;'+
    '&lt;/content&gt;'+
    '&lt;csq&gt;100212&lt;/csq&gt;'+
    '&lt;/m:outgoingEngineMessage&gt;'
Run Code Online (Sandbox Code Playgroud)

我明白了:元素不允许在prolog中...

有人可以告诉我我做错了什么吗?我之前从未使用过xml文件.是否有正确转换xml到utf8的功能?请解释.

xml delphi

0
推荐指数
1
解决办法
1164
查看次数