小编use*_*132的帖子

SerialForms.pas(17):W1010方法'Create'隐藏基类型'TComponent'的虚方法

我创建了一个类

  FormInfo = class (TComponent)
  private
    FLeftValue : Integer;
    FTopValue : Integer;
    FHeightValue : Integer;
    FWidthValue : Integer;
  public
    constructor Create(
      AOwner : TComponent;
      leftvalue : integer;
      topvalue : integer;
      heightvalue : integer;
      widthvalue : integer);
  protected
    procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
    function  GetChildOwner: TComponent; override;
    //procedure SetParentComponent(Value : TComponent); override;
  published
    property LeftValue : Integer read FLeftValue write FLeftValue;
    property TopValue : Integer read FTopValue write FTopValue;
    property HeightValue : Integer read FHeightValue write FHeightValue;
    property WidthValue : …
Run Code Online (Sandbox Code Playgroud)

delphi constructor warnings build delphi-xe2

4
推荐指数
1
解决办法
2955
查看次数

如何从TVirtualStringTree中删除所有节点?

如何在事件处理程序中删除所有节点,包括VirtualStringTree后代,关闭包含VirtualStringTree的表单?

delphi virtualtreeview delphi-xe tvirtualstringtree

3
推荐指数
1
解决办法
916
查看次数

dcc32警告UnloadProcs.pas(59):W1035函数'GetType'的返回值可能未定义

有一种数据类型

type
TDataTypeId = (DataTypeId_String, DataTypeId_SmallInt, DataTypeId_Integer, DataTypeId_Word,
               DataTypeId_Boolean, DataTypeId_Float, DataTypeId_Currency,
               DataTypeId_BCD, DataTypeId_FmtBCD, DataTypeId_Date,
               DataTypeId_Time, DataTypeId_DateTime, DataTypeId_TimeStamp,
               DataTypeId_Bytes, DataTypeId_VarBytes, DataTypeId_Blob,
               DataTypeId_Memo, DataTypeId_Graphic, DataTypeId_fmtMemo,
               DataTypeId_FixedChar, DataTypeId_WideChar, DataTypeId_LargeInt,
               DataTypeId_Array, DataTypeId_FixedWideChar, DataTypeId_WideMemo);
Run Code Online (Sandbox Code Playgroud)

有一个函数接受包含这种类型的值之一的行,返回该值

Function GetType(str: string): TDataTypeId;
var
typeidx: TDataTypeId;
typestr: string;
begin
for typeidx := Low(TDataTypeID) to High(TDataTypeID) do
 begin
  typestr:=GetEnumName(TypeInfo(TDataTypeId),Ord(typeidx));
  typestr:=Copy(typestr, 12, length(typestr)-11);
  //Memo.Lines.Add(typestr+'\n');
  if (AnsiCompareStr(str, typestr)=0) then
     Result:=typeidx
 end;
 end;
Run Code Online (Sandbox Code Playgroud)

结果,有一个组件

[dcc32 Warning] UnloadProcs.pas(59): W1035 Return value of function 'GetType' might be undefined
Run Code Online (Sandbox Code Playgroud)

如何转换未出现警告的功能?

delphi warnings function build delphi-xe2

1
推荐指数
1
解决办法
317
查看次数

SerAndDeser.pas(298):W1036变量'tForm'可能尚未初始化

有一个代码

for j := 0 to mForm.ComponentCount - 1 do
    if mForm.Components[j] is TableFormInfo then
      //try
        //table := nil;
        //tempFmtable := nil;
        //tForm := nil;

        tForm := mForm.Components[j] as TableFormInfo;

        table := TTableSpec(DBSchema.Tables.FindComponent(tForm.Table));
        tempFmtable := TfmTableData.Create(MainWindow);
        tempFmtable.Name := tForm.Name;
        tempFmtable.tname := tForm.Table;
        //tempFmtable.Caption := Utf8ToAnsi(table.Description);
        tempFmtable.Left := tForm.LeftValue;
        tempFmtable.Top := tForm.TopValue;
        tempFmtable.Height := tForm.HeightValue;
        tempFmtable.Width := tForm.WidthValue;

        tempFmTable.IBQuery1.SQL.Clear;
        tempFmtable.IBQuery1.SQL.Add('select * from ' + table.Name);
        tempFmtable.IBQuery1.Open;
        tempFmtable.DragKind:=dkDock;
        tempFmtable.DragMode:=dmAutomatic;

        i := 0;
        querystr:='select ';
        while i <= tForm.ComponentCount - 1 do
          begin …
Run Code Online (Sandbox Code Playgroud)

delphi variables warnings build delphi-xe2

1
推荐指数
1
解决办法
278
查看次数

在Delphi中反序列化时显示表单中的访问冲突

我通过序列化和对Delphi的表单及其内容的反序列化编写了以下代码

unit SerAndDeser;

interface

  uses Classes,MainForm,ListOfTables,DataOfTable,SerialForms,sysutils,ActiveX, DatabaseClasses, UnloadProcs;

  procedure Ser();
  procedure Deser();
  function GetGUID(): string;
  function DeleteSymbols(inputstr : string) : string;
implementation

  function GetGUID(): string;
  var
  GUID : TGUID;
  begin
  Result := '';
  if CoCreateGuid(GUID) = 0 then
    Result := GUIDToString(GUID);
    Result := StringReplace(Result, '{', '', []);
    Result := StringReplace(Result, '}', '', []);
    Result := StringReplace(Result, '-', '', [rfReplaceAll]);
  end;

  function DeleteSymbols(inputstr : string): string;
  begin
  Result := '';
    Result := StringReplace(inputstr, '-', '', [rfReplaceAll]);
    Result := StringReplace(Result, ' ', …
Run Code Online (Sandbox Code Playgroud)

delphi delphi-xe2

0
推荐指数
1
解决办法
1254
查看次数

地址00822135的模块'GUI.exe'中的访问冲突.地址00000040

sqlite是一个数据库 - 一个描述符,包含表列表,域列表,字段列表,限制列表(主键和外键),索引列表.我在Delphi XE3的帮助下,在内置组件的帮助下连接到此基础.有一个单独的模块,其中描述了类TTableSpec,TFieldSpec,TConstraintSpec,TConstraintDetSpec,TDomainSpec.这些类对应于上述sqlite的基础记录.在TTableSpec类中有这样的FFields字段:TComponent成为像TFieldSpec这样的对象的所有者,它们也是从基础上卸载的(例如,DBSchema也包含FTables字段是所有表的所有者),并且在TFieldSpec类中有FDomainSpec字段:TDomainSpec.实际上我给出了一个连接错误的类代码

type
TDataTypeId = (DataTypeId_String, DataTypeId_SmallInt, DataTypeId_Integer, DataTypeId_Word,
               DataTypeId_Boolean, DataTypeId_Float, DataTypeId_Currency,
               DataTypeId_BCD, DataTypeId_FmtBCD, DataTypeId_Date,
               DataTypeId_Time, DataTypeId_DateTime, DataTypeId_TimeStamp,
               DataTypeId_Bytes, DataTypeId_VarBytes, DataTypeId_Blob,
               DataTypeId_Memo, DataTypeId_Graphic, DataTypeId_fmtMemo,
               DataTypeId_FixedChar, DataTypeId_WideChar, DataTypeId_LargeInt,
               DataTypeId_Array, DataTypeId_FixedWideChar, DataTypeId_WideMemo, DataTypeId_Default);
TDBSchemaSpec=class(Tcomponent)
  private
    FDomains: TComponent;
    FTables : TComponent;
  public
    procedure Setup();
    destructor Destroy; override;
    property Domains: TComponent read FDomains;
    property Tables : TComponent read FTables;
end;
TDomainSpec = class(TComponent)
  private
    FName: string;
    FDescription: String;
    FDataTypeId: TDataTypeId;
    FLength: Cardinal;
    FCharLength: Cardinal;
    FPrecision: Cardinal;
    FScale: Cardinal;
    FWidth: Word;
    FAlign: TAlignSpec; …
Run Code Online (Sandbox Code Playgroud)

delphi runtime-error access-violation delphi-xe2

-1
推荐指数
1
解决办法
1922
查看次数