Einzelnen Beitrag anzeigen

DelphiNub

Registriert seit: 20. Nov 2006
11 Beiträge
 
#3

Re: Header übersetzung, kleines Problemchen

  Alt 8. Sep 2008, 17:21
Ja schonmal danke dafür ^^
Hab mal ein wenig in der Doku gekramst und das stand über die SSQ_Callback funktion:

Code:
The SSQ_Callback function is an application-defined callback function.

BOOL WINAPI SSQ_Callback(
   DWORD type,
   PSSQ_REPLY_UNION reply
);
[...]
Return Values:

The function should return TRUE to get all messages of a message loop.
If the function returns FALSE a message loop, if exists, will break.
Von daher nehme ich mal an das dann so aussehen müsste:
SSQ_CALLBACK = function( typ: DWORD; reply: PSSQ_REPLY_UNION ):BOOL; StdCall; Da SSQ_REPLY_UNION ein uniun struct ist und google mir bisher ausgespuckt hat das das dann ein variant record in delphi wäre sieht's bei mir nu so aus:
Delphi-Quellcode:
  
  SSQ_REPLY_UNION = record
    case Word of
     0: (batch_reply: PSSQ_BATCH_REPLY;);
     1: (log_reply: PChar;);
     2: (rules_reply: PSSQ_RULES_REPLY;);
     3: (rcon_reply: PChar;);
     4: (log_notify: Bool;);
  end;
  PSSQ_REPLY_UNION = ^SSQ_REPLY_UNION;
Meine funktion danach dann (als test)
Delphi-Quellcode:
function MyCB( typ: DWORD; reply: PSSQ_REPLY_UNION ): BOOL; stdcall;
begin
  form1.ListBox1.Items.Add( inttostr( typ ) ); // jaja, is nich schön
  result:= true;
end;
Beim OnCreate dann die initialisierung und ein "SSQ_SetCallbackAddress( MyCB )", was auch true zurück gibt, also von daher ja schonmal alles i.O.

Wenn ich nun aber eine funktion aufrufe die damit im zusammenhang steht gibt mir der Debugger: "Invalid parameter/packet" und danach funktioniert garnichts mehr..
  Mit Zitat antworten Zitat