问题标签 [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 投票
1 回答
345 浏览

delphi - 快速访问(排序的)TList

我的项目(在 Delphi 6 上运行!)需要一个内存分配列表(TMemoryAllocation),我将其存储在一个对象中,该对象还保存有关分配大小(FSize)以及分配是否正在使用或空闲(FUsed)的信息. 我基本上将它用作 GarbageCollector 和一种始终保持分配/解除分配内存应用程序的方法(并且需要大量分配/解除分配)。

每当我的项目需要分配时,它都会查找列表以找到适合所需大小的空闲分配。为此,我使用了一个简单的 for 循环:

我的应用程序运行的时间越长,这个列表就会增长到几千个项目,并且当我非常频繁地运行它(每秒几次)时它会大大减慢。

我试图找到一种方法来加速这个解决方案。我考虑过按分配大小对 TList 进行排序。如果我这样做了,我应该使用某种智能方式来访问列表,以获得我在每次通话时需要的特定大小。有一些简单的方法可以做到这一点吗?

我正在考虑的另一种方法是拥有两个 TList。一个用于未使用的分配,一个用于已使用的分配。这意味着尽管我必须从一个列表中提取 TList.Items 并一直添加到另一个列表中。而且我仍然需要使用 for 循环来遍历(现在)较小的列表。这是正确的方法吗?

其他建议也非常受欢迎!

0 投票
0 回答
351 浏览

delphi - WM_QUERYENDSESSION 在 IE8 activeX 控件中不起作用

我有一个用 Delphi 6 编写的 ActiveX 控件,它处理 WM_QUERYENDSESSION 消息以弹出一个消息框,让用户在关闭窗口之前保存更改。它在 IE6 / IE7 中工作正常,但在 IE8 中 ActiveX 控件无法接收 WM_QUERYENDSESSION ,如何解决这个问题?

谢谢

0 投票
3 回答
927 浏览

windows - 使用delphi确定进程虚拟大小

我有一个 Delphi 程序,我正在研究这个程序如何在日志文件中打印它自己的“虚拟大小”,以便我可以看到它何时使用了太多内存。如何使用 Delphi 代码确定“虚拟大小”?

“虚拟大小”是指Process Explorer显示的值。普通任务管理器无法显示此值。它不直接是程序的内存使用量,而是地址空间使用量。在 Win32 上,程序不能使用超过 2 GB 的地址空间。

PS:我使用的是 Delphi 6,但其他版本的代码/信息也应该没问题。

0 投票
1 回答
1272 浏览

delphi - 模块 %s 有打开的后代或链接的模块。无法重新加载

我正在为我的阿拉伯语项目添加一种语言。当我更新资源 Dll 时,我在继承所有其他表单的基本表单之一中收到以下错误。

我尝试将所有表单的 OldCreateOrder 设置为 false,但错误仍然存​​在。我曾尝试在网上搜索这种错误,但没有运气......

有人知道这个错误吗??顺便说一句,我正在使用 Delphi 6 Enterprise 版本。

提前致谢。

0 投票
2 回答
5872 浏览

file - Delphi 6:如何更改创建的文件日期(= 文件创建日期)

我现在一直在谷歌(和这里)上搜索 HOURS。

我找不到解决方案。

我想在DELPHI 6中更改创建的文件时间”(= 创建文件时间)。

不是“修改文件时间”(需要简单调用“FileSetDate()”),而不是“上次访问文件时间”。

我该怎么做呢?

我的意思的图片...

0 投票
1 回答
1059 浏览

delphi - Creating resource only DLL with translated form resources

I have a large application which i want to migrate to Arabic. I have defined the strings that we show to the user under the resourcestring keyword.

I am using the External Translation manager provided with Delphi 6. However, I am not very much comfortable using the tool. I want to create a resource only dll with all the translated strings like how the Delphi ETM does, and then switch between languages at run-time at the click of a button.

I was able to link the resourcestrings to the Dll, but how about form's captions and hints and the component properties? I am loading the Dll at runtime depending on the language, but the form properties are not reflecting as they were not available in the Dll.

Any pointers in the right direction ???

Thanks Rahul W

0 投票
2 回答
4416 浏览

delphi - 如何将 TChart 导出到位图?

我正在使用 Steema Software 和 Delphi 6 的 TeeChart Pro v7.06。在我的项目中有 TChart(其 BottomAxis.Automatic = False)和 TChartScrollBar(滚动)。在 TChart 中有几个系列不适合 TChart 的宽度,所以我使用 TChartScrollBar。

我需要将图表导出到 TBitmap。而且我不知道该怎么做,因为我知道的所有 TChart 方法都只导出 TChart 的可见部分!

有什么方法可以导出整个 TChart,而不仅仅是可见部分?

谢谢!

0 投票
0 回答
498 浏览

delphi - 这个使用页面文件支持的共享内存映射文件的 Delphi 6 代码是否正确?

我有一个 Delphi 6 应用程序和一个 DLL,它们共享一个内存映射文件以在它们之间传输数据。我知道软页面错误是内存映射文件的正常副作用,但我得到的比我想象的要多得多(任务管理器中的高 PF Delta 值约为每秒 2000)。因此,我发布了创建内存映射文件、写入文件并从中读取的代码部分,以查看是否有人能看到我的方法中的一些缺陷。以下是下面的代码摘录。请注意,我使用的是 1MB 的所需文件大小:

0 投票
1 回答
3269 浏览

delphi - Transparent group box

I have inherited from TGroupBox of the Delphi native control and overriden its Paint method to draw rounded rectangle.

After overriding the Create params, the Paint method is as below.

The major problem i m facing is that, i have few labels on top of the transparent group box. When i open the form the labels look fine, but when the text changes, some bounding rectangles of the labels will be visible. This is looking weird on top of transparent box.

Even when i resize the form, the group box itself disappears, when i change the focus to another application and bring back my application, the group box draws itself.

Am i missing anything with respect to drawing? Any windows messages that i need to take care of???

Thanks in advance Rahul

0 投票
1 回答
2875 浏览

delphi - 如何中止 TWeBrowser 导航进度?

德尔福6

我有通过本地 HTML 文件加载 Webbrowser 控件 (TEmbeddedWB) 的代码。它在大多数情况下都可以正常工作,并且已经使用了好几年和 1000 多个用户。

但是有一个特定的最终用户页面有一个脚本,该脚本执行某种谷歌翻译内容,这使得页面需要很长时间才能加载,超过 65 秒。

我正在尝试使网络浏览器停止/中止/退出,以便可以重新加载页面或退出应用程序。但是,我似乎无法让它停下来。我试过停止,加载 about:blank,但它似乎并没有停止。

应用程序在 ReadyState 循环 (ReadyState = READYSTATE_LOADING) 中保持相当长的时间,超过 65 秒。

有人有什么建议吗?