问题标签 [delphi-6]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
3741 浏览

delphi - 在 Delphi 中挂钩 DLL 函数

我有一个 coclass 可以检查注册表以确定是否安装了应用程序,但它做得很差并且找不到更新版本的应用程序。如果安装了竞争应用程序,它将尝试打开该应用程序。如果竞争应用程序已被卸载,程序将崩溃。这个 coclass 是在一个 DLL 文件中定义的,我没有库的源代码,所以我不能改变它。我一直在研究使用挂钩来用一个有效的函数替换该函数,但是当我查看有关使用 SetWindowsHookEx 的 MSDN 文档时,它似乎很复杂。有人可以提供一个如何使用 SetWindowsHookEx 或其他连接 Windows 的方法的示例吗?

谢谢你

编辑:我想指出我接受了我所做的答案,因为它对我有用。在提出问题时我无法使用其他答案,但它看起来一样好。

0 投票
2 回答
2366 浏览

delphi - Delphi - 运行代码而不显示表单

您如何看待这种编程实践: - 我需要在第一个表单中执行一个事务,然后强制执行一些更新,这些更新被放置在另一个表单中(对于在另一个表单中显示的每个项目)。即,它就像显示该表单并单击某个按钮。因为从第二种形式执行这些功能是强制性的,所以我想在不显示第二种形式的情况下这样做。这是良好的编程习惯还是您有其他建议?

另外,在ShowModal之前为第二种形式设置 property> Visible:=False就足够了,还是我需要做一些其他的动作?

0 投票
3 回答
2114 浏览

delphi - Delphi中获取DLL类过程地址

我有一个 DLL 文件,我需要从中获取类过程的内存地址。我正在获取 DLL 文件的句柄,但是当我使用 GetProcAddress 时,我无法获取该过程的地址。我已经为进程名称参数尝试了以下字符串:

在任何情况下,我都没有得到程序的内存地址。我很确定这个程序是公开的。

这样做的字符串格式是什么?声明一个指向外部过程的函数并稍后获取地址会更容易吗?像这样:

0 投票
2 回答
1033 浏览

delphi - 将 .net dll 导入 Delphi 6 会丢失信息

我有一个 .net dll 可以导入到 Delphi 6。但它丢失了一些信息。

我在 VB.net 中有一个演示应用程序来使用这个 dll,它显示了 2 个名为 IRedeemTransactionItemBundleITransactionItemBundle. 在 Visual Studio 2008 中,我可以看到这ITransactionItemBundleIRedeemTransactionItemBundle. 因此,当我声明一个 type 变量时IRedeemTransactionItemBundle,我可以访问两个接口的所有属性。

但是当我将 dll 导入 Delphi 6 时,我可以同时看到IRedeemTransactionItemBundle声明ITransactionItemBundle部分。但是没有信息表明ITransactionItemBundleIRedeemTransactionItemBundle. 此外,当我在 Delphi 中声明类型变量时IRedeemTransactionItemBundle,我无法访问ITransactionItemBundle(基本类型)的属性。

当我尝试通过将基本类型设置为IRedeemTransactionItemBundle来在 tlb 编辑器中注册库时ITransactionItemBundle,我收到错误消息:“父接口已经有一个 id:1610743808 的成员”。我可以在 tlb 编辑器中看到两个接口的属性具有相同的 ID。

我也尝试使用 Delphi 7 导入相同的 dll。但没有帮助。

这是德尔福的问题吗?你们有没有人在导入时遇到过这样的问题,请给我一些想法?

0 投票
1 回答
457 浏览

delphi - 传递 nil 作为参数代替 TComponent

当将 nil 传递给期望 TComponent 的构造函数时,我遇到了一些引发异常(不支持 EIntfCasterror Cast)的代码,如下所示:

它所在的单元不包含表单,甚至 TForm 也需要在调用其构造函数时将 TComponent 传递给它。如果存在任何东西,或者有办法让它接受零,我应该通过什么来代替零。

谢谢你。

另外,我没有调用这个方法的源代码,或者我只是让它传递它可以访问的表单。

编辑:修复了代码示例。

EDIT2:修复了代码示例,因为我第一次写它时有第二个脑子放屁。

EDIT3:我也没有构造函数的代码。

0 投票
2 回答
280 浏览

delphi - Delphi 6 中的 IntfCast

我有一个项目,其中大量源代码不可用。其中一个函数存在 IntfCast 异常,我一直在使用 CPU 调试器逐步执行应用程序,并确定了包含强制转换操作的函数和所涉及的类之一,但我无法识别另一个类。我正在尝试复制错误,但我正在尝试的强制转换操作没有调用 IntfCast。如何让演员调用 IntfCast?

谢谢你。

0 投票
2 回答
858 浏览

delphi - 如何从 Delphi6 迁移到 Delphi2010(Unicode 问题)

嗨,我在 Delphi 6 中使用 Francois Piette 的 RasDial,但它在 Delphi 2010 中停止工作 我怎样才能像以前一样继续使用这些功能?

0 投票
2 回答
3880 浏览

delphi - Delphi中的const函数

在我正在查看的 Delphi 代码中,我发现了以下几行:

这是在做什么?我的意思是,不是函数中的实际代码,而是在 const 部分中声明一个函数并将其与变量值进行比较(?)它做了什么?我假设单个等于是一个比较,因为这就是德尔福其他地方的情况。

谢谢你。

0 投票
1 回答
1621 浏览

delphi - I'd like to make a websocket handshake with delphi6

I'm trying to build a websocket server on Delphi6 using the draft hixie-76 and i have a problem with the handshake.

The md5 fingerprint i get with the three parts does not seem to be correct when i try it, but when i use the same algorythm with the exemple given in the protocole spec i get the good md5 response...

I'm processing like this, transform the number found in key1 divided by the number of spaces in a 32 bits word, same with key2 and finally adding the last 8 bytes (key3) to get a 128 bits string which i use as md5 entry.

using 155712099, 173347027 for key1 and key2 and 'Tm[K T2u' for key3, i get the correct md5 fingerprint and so i don't understand why this algo won't give a correct fingerprint to the client

here is an exemple of what i receive :

and the handshake i give in response

Maybye there's another probleme with my response but it reall seems that i have a problem with my md5 fingerprint.

Does anyone see where my mistake is??

Thanks in advance for your help

Update

I have seen this unit but unless i'm very bad at reading, the handshake part of this class does not calculate any md5 sum, i think it uses an older version of the protocol and not the current (76)

When i look at the following code i see that the answer is written without any md5 response.

` try // Read request headers HandshakeRequest := TWebSocketRequest.Create(ServerConnection);

except on E: TWebSocketHandshakeException do begin // Close the connection if the handshake failed ServerConnection.Disconnect; end;`

Thanks again

Update 2011 04 14

I have finally found where the problem was...

i was building my response like that :

resp := [...] +'Sec-WebSocket-Origin: '+ origin + #13#10 +
#13#10#13#10 +
md5response;
so there was 3 0x0D 0x0A instead of 2 before the md5 fingerprint ...

Since i cannot answer my own question i won't be able to mark it solve but it is! :)

0 投票
1 回答
2121 浏览

delphi - 使用 Delphi 2010 进行狂欢报告

我们正在尝试使用 Rave Reports 将 Delphi 6 迁移到 Delphi 2010。Delphi 6 使用 TReportPrinter 打印结果。Delphi 2010 中没有 Rave 组件。

您能否指导如何进行以及我们可以使用 Rave 7.7 的哪个组件进行打印?

谢谢,

作为