Delphi 7 IDE 堆栈溢出错误

发布于 2024-12-06 14:07:25 字数 1998 浏览 0 评论 0原文

谁能告诉我,为什么我总是收到以下错误?

背景:

该项目有 320 个嵌入式表单。

该项目搜索路径有 205 个文件夹,长度刚刚超过 11,000 个字符。

如果我只注释掉 1 个嵌入表单单元,那么它编译时不会出现错误。

IMAGE #1 - 来自 Delphi IDE

在此处输入图像描述

IMAGE #2 - 来自DCC32.EXE

在此处输入图像描述

这是我用于嵌入表单的单位

unit EmbeddedForm;

interface

{$INCLUDE '..\INCLUDE\BUILD.INC'}

uses
  Windows, Controls, Messages, Forms;

type
  TEmbeddedForm = class(TForm)
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    procedure StopFlicker(var theMessage: TWMEraseBkgnd); message WM_ERASEBKGND;
  protected
    { Protected declarations }
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public declarations }
    procedure InitializeForm(); virtual; abstract;
    procedure FinalizeForm(); virtual; abstract;
  end;

implementation

{$R *.DFM}
procedure TEmbeddedForm.StopFlicker(var theMessage: TWMEraseBkgnd);
begin
  theMessage.Result := 1;
end;

procedure TEmbeddedForm.CreateParams(var Params: TCreateParams);
const
  ParamStyle = WS_VISIBLE or WS_POPUP or WS_OVERLAPPED or WS_OVERLAPPEDWINDOW;
begin
  inherited CreateParams(Params);
  Params.ExStyle := (Params.ExStyle and (not WS_EX_WINDOWEDGE)
    and (not WS_EX_STATICEDGE) and (not WS_EX_DLGMODALFRAME) and (not WS_EX_CLIENTEDGE));
  Params.Style := (Params.Style and (not WS_CAPTION) and (not DS_MODALFRAME)
    and (not WS_DLGFRAME) and (not WS_THICKFRAME));
  Params.Style := Params.Style and not ParamStyle;
end;

procedure TEmbeddedForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  CanClose := False;
end;

procedure TEmbeddedForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caNone;
end;

end.

Could anyone tell me, why I keep getting the following errors?

Background:

The project has 320 Embedded Forms.

The projects search path has 205 folders, at a length of just over 11,000 chars.

If I remark out just 1 of the embedded form units, then it compiles without an error.

IMAGE #1 - From Delphi IDE

enter image description here

IMAGE #2 - From DCC32.EXE

enter image description here

Here is the unit I use for my embedded forms

unit EmbeddedForm;

interface

{$INCLUDE '..\INCLUDE\BUILD.INC'}

uses
  Windows, Controls, Messages, Forms;

type
  TEmbeddedForm = class(TForm)
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    procedure StopFlicker(var theMessage: TWMEraseBkgnd); message WM_ERASEBKGND;
  protected
    { Protected declarations }
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public declarations }
    procedure InitializeForm(); virtual; abstract;
    procedure FinalizeForm(); virtual; abstract;
  end;

implementation

{$R *.DFM}
procedure TEmbeddedForm.StopFlicker(var theMessage: TWMEraseBkgnd);
begin
  theMessage.Result := 1;
end;

procedure TEmbeddedForm.CreateParams(var Params: TCreateParams);
const
  ParamStyle = WS_VISIBLE or WS_POPUP or WS_OVERLAPPED or WS_OVERLAPPEDWINDOW;
begin
  inherited CreateParams(Params);
  Params.ExStyle := (Params.ExStyle and (not WS_EX_WINDOWEDGE)
    and (not WS_EX_STATICEDGE) and (not WS_EX_DLGMODALFRAME) and (not WS_EX_CLIENTEDGE));
  Params.Style := (Params.Style and (not WS_CAPTION) and (not DS_MODALFRAME)
    and (not WS_DLGFRAME) and (not WS_THICKFRAME));
  Params.Style := Params.Style and not ParamStyle;
end;

procedure TEmbeddedForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  CanClose := False;
end;

procedure TEmbeddedForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caNone;
end;

end.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜未央樱花落 2024-12-13 14:07:25

您可以尝试使用PE编辑器来增加IDE或dcc32的堆栈大小。但首先要做好备份! Editbin 应该可以解决问题。

You could try using a PE editor to increase the stack size of IDE or dcc32. But make backups first! Editbin should do the trick.

尤怨 2024-12-13 14:07:25

尝试更改这些值:

项目 - >选项 - >链接器 - >内存大小

最小堆栈大小(十六进制值)

最大堆栈大小(十六进制值)

Try to change these values:

Project->Options->Linker->Memory sizes

Min stack size as hex value

Max stack size as hex value

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文