Einzelnen Beitrag anzeigen

omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#10

Re: DLL einbinden octopus.dll

  Alt 24. Jul 2008, 02:07
Versuch es mal so...
Delphi-Quellcode:
type
  octopus_context = packed record
    usb_handle : integer;
    error_str : pchar;
  end;
  Poctopus_context = ^octopus_context;

function octopus_init(context: Poctopus_context): integer; stdcall; external 'octopus.dll';
function octopus_open(context: Poctopus_context): integer; stdcall; external 'octopus.dll';
Aufruf...
Delphi-Quellcode:
var context:Poctopus_context;
begin
  new(context);
  try
    if octopus_init(context) = 0 then
      raise Exception.Create(context.error_str);

    if octopus_open(context) < 0 then
      raise Exception.Create(context.error_str);

  finally
    dispose(context);
  end;
end;
Das Init läuft durch, beim Open erhalte ich die folgende Meldung: "could not found octopus device with pid and vid". Diese Meldung ist ja schonmal vielversprechend, ich habe ja auch kein Gerät. Aber es kommt eben auch keine Access Violation mehr.
  Mit Zitat antworten Zitat