Delphi初心者のための寺子屋at TECH
Delphi初心者のための寺子屋 - 暇つぶし2ch522:デフォルトの名無しさん
08/03/06 09:27:41
>>513

昨日メモリについて質問した者です。
気になる事がありましたので、お聞き致します。
仮に

SetLength(buf,1);
buf[1] := Chr($29A);
WriteProcessMemory(hProces, ptr(Address), PChar(buf), length(buf), WriteSize);
CloseHandle(hProces);

をbuf[1] := Chr($29A);としたい場合は、
function StrToByte(const s: string): byte;
var
i, n : integer;
begin
result := 0;

n := 1;
i := Length(s);
while (i > 0) and (n <= 128) do begin
if s[i] = '1' then
Inc(result, n);

n := n *2;
Dec(i);
end;
end;

を使ってbuf[1] := Chr(StrToByte('$29A'));を使って同様の結果がでないのはなぜでしょうか?



次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch