Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#5

Re: Tipps für Header-Übersetzungen

  Alt 29. Jul 2004, 05:35
Die Rückgabewerte sind BOOL, laut PSDK. Ich habe es jetzt für Delphi in LongBool geändert.
So das ganze sieht jetzt so aus:
Delphi-Quellcode:
{************************************************************}
{                                                            }
{                       MpuTimerQueue                        }
{                                                            }
{               Copyright (c) 2004 Michael Puff              }
{                                                            }
{  When I die I want 'Hello, world' carved on my headstone.  }
{                                                            }
{************************************************************}

unit MpuTimerQueue;

interface

uses
  windows;

const
  WT_EXECUTEDEFAULT = $00000000;
  WT_EXECUTEINIOTHREAD = $00000001;
  WT_EXECUTEINUITHREAD = $00000002;
  WT_EXECUTEINWAITTHREAD = $00000004;
  WT_EXECUTEONLYONCE = $00000008;
  WT_EXECUTEINTIMERTHREAD = $00000020;
  WT_EXECUTELONGFUNCTION = $00000010;
  WT_EXECUTEINPERSISTENTIOTHREAD = $00000040;
  WT_EXECUTEINPERSISTENTTHREAD = $00000080;
  WT_TRANSFER_IMPERSONATION = $00000100;

type
  WAITORTIMERCALLBACKFUNC = procedure(P: Pointer; B: Boolean); stdcall;
  TWAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC;

function CreateTimerQueue: THandle; stdcall;
function CreateTimerQueueTimer(var NewTimer: THandle; TimerQueue: THandle;
  Callback: TWAITORTIMERCALLBACK; Parameter: Pointer; DueTime, Period: DWORD;
  Flags: ULONG): LongBool; stdcall;
function ChangeTimerQueueTimer(TimerQueue: THandle; Timer: THandle; DueTime:
  ULONG; Period: ULONG): LongBool; stdcall;
function DeleteTimerQueueTimer(TimerQueue, Timer, CompletionEvent: THandle):
  LongBool; stdcall;
function DeleteTimerQueueEx(TimerQueue: THandle; CompletionEvent: THandle):
  LongBool;

implementation

function CreateTimerQueue; external kernel32 name 'CreateTimerQueue';
function CreateTimerQueueTimer; external kernel32 name 'CreateTimerQueueTimer';
function ChangeTimerQueueTimer; external kernel32 name 'ChangeTimerQueueTimer';
function DeleteTimerQueueTimer; external kernel32 name 'DeleteTimerQueueTimer';
function DeleteTimerQueueEx; external kernel32 name 'DeleteTimerQueueEx';

end.
Für den C Builder habe ich es noch nicht angepasst. Was muss ich da noch machen und was bewirken die Direktiven? Und was macht dcc32.exe -JPHNE Foo.pas? da hab eich jetzt eine hpp-Datei. Was ist denn das?
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat