Delphi 7 IDE堆栈溢出错误

时间:2011-09-26 00:58:15

标签: delphi ide delphi-7 stack-overflow

有人能告诉我,为什么我一直收到以下错误?

背景

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

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

如果我只注释了一个嵌入的表单单元,那么它会编译而不会出错。

图片#1 - 来自Delphi IDE

enter image description here

图片#2 - 来自DCC32.EXE

enter image description here

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

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.

2 个答案:

答案 0 :(得分:5)

您可以尝试使用PE编辑器来增加IDE或dcc32的堆栈大小。但先备份! Editbin应该做到这一点。

答案 1 :(得分:0)

尝试更改这些值:

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

最小堆栈大小为十六进制值

最大堆栈大小为十六进制值