Einzelnen Beitrag anzeigen

multi-man

Registriert seit: 9. Jul 2008
16 Beiträge
 
Delphi 7 Professional
 
#9

Re: DLL einbinden octopus.dll

  Alt 23. Jul 2008, 21:27
Zitat von omata:
eventuell sind das alles Zeiger...
Delphi-Quellcode:
type
  usb_device_handle = record
  end;

  Pusb_device_handle = ^usb_device_handle;

  octopus_context = record
    usb_handle : Pusb_device_handle;
    error_str : pchar;
  end;
  Poctopus_context = ^octopus_context;
function octopus_init(context: Poctopus_context): integer; stdcall; external 'octopus.dll';
Delphi-Quellcode:
var context:Poctopus_context;
begin
  new(context);
  if octopus_init(context) <> 0 then
  begin
  end;
end;
Habe ich probiert, aber leider will es so auch nicht, er bekommt zwar ne 1 zurück, aber anschliessend kommt gleich wieder ne exception... Hab mal geschaut, also der wert von context ist vor dem Aufruf der DLL natürlich irgendein Wert, wenn die DLL-Funktion aber vorbei ist, dann ist context NIL ...
  Mit Zitat antworten Zitat