Thema: Delphi Operator not applicable

Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

Operator not applicable

  Alt 21. Apr 2007, 06:12
Hi

Langsam wirds immer schwiriger

Delphi-Quellcode:
function GetPresetCount(var pnPresetCount: LongInt): HRESULT;
Var
  IntVal: integer;

begin
  if (IWmpEffects <> 0) then
    begin
       IntVal := 0;
       result := IWmpEffects.GetPresetCount(IntVal);
       pnPresetCount := IntVal;

    end else
    result := -1;

end;
Zwei Fehler in einer function.
if (IWmpEffects <> 0) then 0 normalerweise in C# 'null' wie im MS Beispiel.

gibt in Delphi den Fehler aus.
[Pascal Error] WMPUnit.pas(218): E2015 Operator not applicable to this operand type

IWmpEffects.GetPresetCount(IntVal); laut MS Beispiel IWmpEffects.GetPresetCount(ref IntVal);
ref dürfte var sein funktioniert aber nicht!
Zusätzlich kommt noch die Meldung
[Pascal Error] WMPUnit.pas(221): E2018 Record, object or class type required für den bereich (ref IntVal);

Delphi-Quellcode:
IWMPEffects = interface(IUnknown)
   ['{D3984C13-C3CB-48e2-8BE5-5168340B4F35}']
   procedure GetPresetCount(var pnPresetCount : LongInt); safecall;
Jemand ne Idee was da falsch läuft ?

Gruss Emil
  Mit Zitat antworten Zitat