![]() |
Operator will wieder nicht!
Hi
Delphi-Quellcode:
Type EffectsCapability =
(EFFECT_CANGOFULLSCREEN = $00000001, // can the effect go full screen? EFFECT_HASPROPERTYPAGE = $00000002, // does the effect have a property page? EFFECT_VARIABLEFREQSTEP = $00000004, // should effect return frequency data with variable size steps? EFFECT_WINDOWEDONLY = $00000008, EFFECT2_FULLSCREENEXCLUSIVE = $00000010);
Delphi-Quellcode:
Fehler:
Var
dwCaps : LongInt; CanGoFullScreen : boolean; WindowedOnly : boolean; FullScreenExclusive : boolean; begin if not Assigned(_IWmpEffects) then begin result := false; exit; end; dwCaps := 0; GetCapabilities(dwCaps); CanGoFullScreen := (dwCaps and EFFECT_CANGOFULLSCREEN); Zitat:
Delphi-Quellcode:
Warum?
CanGoFullScreen := (dwCaps and EFFECT_CANGOFULLSCREEN);
gruss Emil |
Re: Operator will wieder nicht!
du versuchst einem Boolean Ordinalwert zu zuweisen (und einen Integer konnte man noch nie einem Boolean zuweisen). Ein einfacher Cast und es funktioniert.
|
Re: Operator will wieder nicht!
Zitat:
Delphi-Quellcode:
Wenn ja , geht auch nicht.
CanGoFullScreen := bool(dwCaps and EFFECT_CANGOFULLSCREEN);
gruss Emil |
Re: Operator will wieder nicht!
Delphi-Quellcode:
CanGoFullScreen := (dwCaps and EFFECT_CANGOFULLSCREEN) > 0;
|
Re: Operator will wieder nicht!
oh, ich seh gerade das EFFECT_CANGOFULLSCREEN kein Integer, Cardinal etc. ist sondern Teil eines Enums. Daher wäre es das sinnvollste dwCaps als "Set of" zu declarieren oder wenn es so bleiben soll wie es ist musst du EFFECT_CANGOFULLSCREEN auf Byte casten.
Delphi-Quellcode:
CanGoFullScreen := Boolean((dwCaps and Byte(EFFECT_CANGOFULLSCREEN)));
|
Re: Operator will wieder nicht!
Zitat:
War mein ursprünglicher code. Geht aber nicht! [Pascal Error] WMPUnit.pas(1198): E2015 Operator not applicable to this operand type [Pascal Warning] WMPUnit.pas(1198): W1023 Comparing signed and unsigned types - widened both operands Gruss Emil |
Re: Operator will wieder nicht!
Thanks SirThornberry
Jetzt gehts ;) Gruss Emil |
Re: Operator will wieder nicht!
Wenn Du es so machst, sollte es gehen:
Delphi-Quellcode:
const EFFECT_CANGOFULLSCREEN = $00000001, // can the effect go full screen?
EFFECT_HASPROPERTYPAGE = $00000002; // does the effect have a property page? EFFECT_VARIABLEFREQSTEP = $00000004; // should effect return frequency data with variable size steps? EFFECT_WINDOWEDONLY = $00000008; EFFECT2_FULLSCREENEXCLUSIVE = $00000010; type EffectsCapability = ( EFFECT_CANGOFULLSCREEN, EFFECT_HASPROPERTYPAGE, EFFECT_VARIABLEFREQSTEP, EFFECT_WINDOWEDONLY, EFFECT2_FULLSCREENEXCLUSIVE); |
Re: Operator will wieder nicht!
Zitat:
Ich habs jetzt so und müßte funktionieren. Trotzdem Danke für die info
Delphi-Quellcode:
function BASS_WMPVIS_SetFullScreen(FullScreen: BOOL): boolean; stdcall;
Var hr : HRESULT; dwCaps : LongInt; CanGoFullScreen : boolean; WindowedOnly : boolean; FullScreenExclusive : boolean; begin if not Assigned(_IWmpEffects) then begin result := false; exit; end; dwCaps := 0; GetCapabilities(dwCaps); CanGoFullScreen := Boolean((dwCaps and Byte(EFFECT_CANGOFULLSCREEN))); WindowedOnly := Boolean((dwCaps and Byte(EFFECT_WINDOWEDONLY))); FullScreenExclusive := Boolean((dwCaps and Byte(EFFECT2_FULLSCREENEXCLUSIVE))); if (not CanGoFullScreen or WindowedOnly or FullScreenExclusive) then begin result := false; exit; end; hr := GoFullscreen(FullScreen); Result := hr = S_OK; end; |
Re: Operator will wieder nicht!
ein Set erscheint mir hier sonnvoller (dwCaps) - dann könnte man einfach mit "in" überprüfen.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:05 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz