Einzelnen Beitrag anzeigen

Billi Berserker
(Gast)

n/a Beiträge
 
#8

Re: Mixer in Windows Vista

  Alt 2. Sep 2007, 20:53
Nächste Frage ist dann wie ich die Interfaces überhaupt benutze.
Ich habe jetzt
Delphi-Quellcode:
const
  IID_IMMDeviceEnumerator : TGUID = '{A95664D2-9614-4F35-A746-DE8DB63617E6}';
type
  IMMDeviceEnumerator = interface(IUnknown)
    ['{A95664D2-9614-4F35-A746-DE8DB63617E6}']
    function EnumAudioEndpoints(dataFlow : EDataFlow; dwStateMask : DWord; out ppDevices : IMMDeviceCollection) : hresult; stdcall;
    function GetDefaultAudioEndpoint(dataFlow : EDataFlow; role : ERole; out ppDevice : IMMDevice) : hresult; stdcall;
    function GetDevice(pwStrID : LPCWSTR; out ppDevice : IMMDevice) : hresult; stdcall;
    function RegisterEndpointNotificationCallback(pNotify : IMMNotificationClient) : hresult; stdcall;
    function UnregisterEndpointNotificationCallback(pNotify : IMMNotificationClient) : hresult; stdcall;
  end;
Beim versuch das ganze zu benutzen:
Delphi-Quellcode:
var
var
  hr : hresult;
  pIMMDeviceEnumerator : IMMDeviceEnumerator;
begin
  CoInitialize(nil);
  hr := CoCreateInstance(IID_IMMDeviceEnumerator, nil, CLSCTX_INPROC_SERVER, IMMDeviceEnumerator, pIMMDeviceEnumerator);
  CoUnInitialize();
end;
bekomm ich einen "REGDB_E_CLASSNOTREG" Fehler.
Zitat:
REGDB_E_CLASSNOTREG
A specified class is not registered in the registration database. Also can indicate that the type of server you requested in the CLSCTX enumeration is not registered or the values for the server types in the registry are corrupt.
Die GUID müßte jedoch mit {A95664D2-9614-4F35-A746-DE8DB63617E6} auf jedenfall stimmen da ich das direkt aus dem win32 sdk gezogen habe
Code:
EXTERN_C const IID IID_IMMDeviceEnumerator;
   
    MIDL_INTERFACE("A95664D2-9614-4F35-A746-DE8DB63617E6")
  Mit Zitat antworten Zitat