问题标签 [delphi]

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 投票
6 回答
873 浏览

.net - 从非托管代码中使用 DLR

是否可以从非托管代码(如 C++ 或 Delphi)调用托管代码,特别是 IronRuby 或 IronPython?

例如,我们有一个用 Delphi 编写的应用程序正在迁移到 C#.NET 我们想在我们的新应用程序中提供 Ruby 或 Python 脚本来替换 VBSCRIPT。但是,我们需要在旧的 Delphi 应用程序中提供 Ruby/Python 脚本。是否可以从 Delphi 代码中使用 IronRuby/IronPython 提供的托管 dll?

0 投票
7 回答
31481 浏览

delphi - 使用 Delphi 的 7-Zip?

我想使用 Delphi 的 7-Zip DLL,但找不到合适的文档或示例。有谁知道如何使用 Delphi 的 7-Zip DLL?

0 投票
5 回答
1760 浏览

delphi - Delphi 资源不足

我使用 Delphi 7 编译的每个项目(我使用运行时包编译)都会给出链接器错误:“资源过多”。即使是空白应用程序也会出现此错误。

换句话说:德尔福死在我身上。

0 投票
3 回答
2027 浏览

delphi - 在 Delphi 中,如何从防火墙 API 中的 LocalPolicy.CurrentProfile.GloballyOpenPorts 获取枚举器

我正在编写一些代码,以查看WinXPVista的防火墙例外列表中是否存在针对我们客户端软件使用的特定端口的漏洞。

我可以看到我可以使用NetFwMgr.LocalPolicy.CurrentProfile.GloballyOpenPorts来获取当前开放端口异常的列表。但我不知道如何将枚举列表放入我可以在我的 Delphi 程序中使用的东西中。

下面列出了我的最新尝试。当我使用port_list.Item. 我知道那是错误的,这主要是我的一厢情愿。任何帮助,将不胜感激。

0 投票
2 回答
3224 浏览

delphi - 如何修复损坏的 Delphi 2009 安装

当我收到 Delphi 2009 试用版和实际版本时,我通过 Web 安装程序安装了它们,并且在安装它们时遇到了相同的错误。

两次似乎核心 Web 安装程序在生成用于 boost、文档和 dbtools 的附加安装包时都失败了。(它打开了一个查找文件对话框,询问我的机器上不存在的 setup.msi)。取消此操作时,安装程​​序报告了一个致命错误。

卸载程序没有出现在我的程序列表中,也不会从安装文件夹启动。

未来尝试启动安装程序时,它认为 Delphi 2009 已经安装,并且不会更正、修复或卸载它。

0 投票
6 回答
4785 浏览

multithreading - 在 Delphi 中,TDataSet 线程安全吗?

我希望能够在它自己的线程中异步打开一个 TDataSet,以便主 VCL 线程可以继续运行直到完成,然后让主 VCL 线程从该 TDataSet 读取。我做了一些实验并且遇到了一些非常奇怪的情况,所以我想知道是否有人以前做过。

我见过一些示例应用程序,其中 TDataSet 在单独的线程中创建,它被打开,然后从中读取数据,但这都是在单独的线程中完成的。我想知道在另一个线程打开数据源之后从主 VCL 线程读取 TDataSet 是否安全。

我在 Delphi 7 中进行 Win32 编程,使用来自DAC for MySQL的 TmySQLQuery作为我的 TDataSet 后代。

0 投票
1 回答
773 浏览

asp.net - 传输文件,以奇怪的行为下载

我正在使用 httpresponse.Transmitfile 下载文件。如果我在文件下载对话框中选择保存在与建议文件夹不同的文件夹中,下载速率会下降到 10 - 20 kb。如果我取消,或者总是选​​择在同一个文件夹中下载,那么传输速率是 200 kb 或更多。这是我的代码:

这是在 RadStudio 2007,Delphi for .Net 中编写的。有没有人经历过这样的事情?这在 Opera 或 Firefox 中不是问题,只有 Internet Explorer。

0 投票
4 回答
2288 浏览

delphi - Opening two HTMLHelp files simultaneously in Delphi causes both help windows to hang

In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed.

In addition to TApplication.HelpFile, each form also has a TForm.HelpFile property which can be used to specify a different (separate) help file for help calls originating from that specific form.

If an application's main help window is already open however, and a help call is made display help from a secondary help file, both help windows hang. Neither of the help windows can now be accessed, and neither can be closed. The only way to get rid of the help windows is to close the application, which results in both help windows being automatically closed as well.

Example:

The last line of code above opens the secondary help window (but with no content) and then both help windows hang.

My Question is this:

  1. Is it possible to display two HTMLHelp windows at the same time, and if so, what is the procedure to be followed?

  2. If not, is there a way to tell whether or not an application's help window is already open, and then close it programatically before displaying a different help window?

(I am Using Delphi 2007 with HTMLHelp files on Windows Vista)

UPDATE: 2008-09-18

Opening two help files at the same time does in fact work as expected using the code above. The problem seems to be with the actual help files I was using - not the code.

I tried the same code with different help files, and it worked fine.

Strangely enough, the two help files I was using each works fine on it's own - it's only when you try to open both at the same time that they hang, and only if you open them from code (in Windows explorer I can open both at the same time without a problem).

Anyway - the problem is definitely with the help files and not the code - so the original questions is now pretty much invalid.

UPDATE 2: 2008-09-18

I eventually found the cause of the hanging help windows. I will post the answer below and accept it as the correct one for future reference. I have also changed the questions title.

Oops... It seems that I cannot accept my own answer...

Please vote it up so it stays at the top.

0 投票
3 回答
3798 浏览

delphi - 防止在 Delphi 包中隐式导入单位

有没有办法防止 Delphi 中的包隐式导入“包含”列表中未列出的单元?我正在寻找一个编译器指令,如果它试图进行隐式导入,它会使构建失败。

当您将一个包安装到隐式导入单元 A 的 IDE 中,然后您尝试安装另一个真正包含单元 A 的包并且 IDE 告诉您它无法安装该包时,会出现问题,因为单元 A 已经包含在第一个包中如果不应该!

0 投票
3 回答
346 浏览

sql-server - 迁移现有应用程序以接受 Unicode

我们正在将我们的应用程序升级到完全兼容 Unicode,因为我们最近获得了开箱即用的 Delphi 2009。我正在寻找任何有升级应用程序以接受 Unicode 字符的经验的人。具体回答以下任何问题。

  • 我们需要将 VarChars 更改为 NVarchar,将 Char 更改为 NChar。这里有什么陷阱吗。
  • 我们需要更新所有 sql 语句以在任何 sql 字符串前面包含 N。所以 Update tbl_Customer set Name = 'Smith' 必须变成 Update tbl_Customer set Name = N 'Smith' 。对于某些字段,有什么方法可以默认此设置。这似乎是非同寻常的,这仍然是必需的。
  • 是否可以在 SQLServer 中设置任何默认值来简化此操作?

ps 我们还需要升级我们的Oracle代码