91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

ComBoBox控件,如果里面有item為空,那么就報ntdll.dll的解決辦法

發布時間:2020-08-03 10:35:05 來源:網絡 閱讀:518 作者:sbabzc 欄目:軟件技術

 ComBoBox控件,如果里面有item為空,那么就報ntdll.dll的解決辦法

經過在網上查詢,終于找到了一個解決方案,下載到了一個pas文件

把這個pas文件 add to project 后,就不報錯了,確實不錯

---------------------------------

復制下面的代碼,保存到 D7ComboBoxStringsGetPatch.pas 即可

 

------------------------------------------

unit D7ComboBoxStringsGetPatch;

 

// The patch fixes TCustomComboBoxStrings.Get method for empty string item in Delphi 7.

 

interface

 

{$IF RTLVersion <> 15.0}

'This patch is intended for Delphi 7 only';

{$IFEND}

 

implementation

 

uses

  Windows, SysUtils, StdCtrls;

 

resourcestring

  RsPatchingFailed = 'TCustomComboBoxStrings.Get patching failed.';

 

type

  TPatchResult = (prNotNeeded, prOk, prError);

 

function PatchCode(RoutineStartAddr: Pointer; PatchOffset: Cardinal; OriginalCode: Pointer;

  OriginalCodeLen: Cardinal; PatchedCode: Pointer; PatchedCodeLen: Cardinal): TPatchResult;

const

  JmpOpCode = $25FF;

type

  PPackageThunk = ^TPackageThunk;

  TPackageThunk = packed record

    JmpInstruction: Word;

    JmpAddress: PPointer;

  end;

var

  CodeStart: Pointer;

  BytesWritten: DWORD;

begin

  if FindClassHInstance(System.TObject) <> HInstance then

    with PPackageThunk(RoutineStartAddr)^ do

      if JmpInstruction = JmpOpCode then

        RoutineStartAddr := JmpAddress^

      else

      begin

        Result := prError;

        Exit;

      end;

  CodeStart := Pointer(LongWord(RoutineStartAddr) + PatchOffset);

  if CompareMem(CodeStart, OriginalCode, OriginalCodeLen) then

  begin

    if WriteProcessMemory(GetCurrentProcess, CodeStart, PatchedCode, PatchedCodeLen, BytesWritten) and

      (BytesWritten = PatchedCodeLen) then

    begin

      FlushInstructionCache(GetCurrentProcess, CodeStart, PatchedCodeLen);

      Result := prOk;

    end

    else

      Result := prError;

  end

  else

    Result := prNotNeeded;

end;

 

type

  TCustomComboBoxStringsHack = class(TCustomComboBoxStrings);

 

function AddrOfTCustomComboBoxStringsGet: Pointer;

begin

  Result := @TCustomComboBoxStringsHack.Get;

end;

 

procedure PatchTCustomComboBoxStringsGet;

const

  OriginalCode: Cardinal  = $74FFF883; // CMP EAX, -1 | JZ  +$26

  PatchedCode: Cardinal   = $7E00F883; // CMP EAX,  0 | JLE +$26

  PatchOffset             = $1F;

  // for DEBUG DCU by Pavel Rogulin

  OriginalCodeD: Cardinal = $FFF07D83;

  PatchedCodeD: Cardinal  = $00F07D83;

  PatchOffsetD            = $2E;

var

  PatchResult: TPatchResult;

begin

  PatchResult := PatchCode(AddrOfTCustomComboBoxStringsGet, PatchOffset, @OriginalCode, SizeOf(OriginalCode),

    @PatchedCode, SizeOf(PatchedCode));

  if PatchResult = prNotNeeded then

    PatchResult := PatchCode(AddrOfTCustomComboBoxStringsGet, PatchOffsetD, @OriginalCodeD, SizeOf(OriginalCodeD),

      @PatchedCodeD, SizeOf(PatchedCodeD));

  case PatchResult of

    prError:

      begin

        if IsConsole then

          WriteLn(ErrOutput, RsPatchingFailed)

        else

          MessageBox(0, PChar(RsPatchingFailed), nil, MB_OK or MB_ICONSTOP or MB_TASKMODAL);

        RunError(1);

      end;

  end;

end;

 

initialization

  PatchTCustomComboBoxStringsGet;

 

end.

 

本文地址:http://www.xszlo.com/article/2012-11-10/7497.html,轉發請保留這個地址,謝謝

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

鲁甸县| 正蓝旗| 郓城县| 达尔| 通渭县| 太谷县| 巫溪县| 新丰县| 大宁县| 天等县| 维西| 永安市| 二手房| 鹰潭市| 香格里拉县| 万盛区| 玛多县| 河东区| 新巴尔虎右旗| 庆城县| 元朗区| 车致| 永年县| 锡林浩特市| 石城县| 穆棱市| 洪洞县| 沽源县| 米泉市| 柳州市| 栖霞市| 昌图县| 华宁县| 通州市| 天峻县| 建阳市| 红桥区| 巢湖市| 山丹县| 新巴尔虎左旗| 林周县|