none
MIDL2020 : error generating type library : LayOut failed

    Question

  • Hi,

    I'm compiling an IDL file into a type library but I get the error in object:

    midl\oleaut32.dll : error MIDL2020 : error generating type library : LayOut failed : IAudioDevice (0x80029C83)

    The IAudioDevice interface is declared as:

      typedef 
      [ 
        uuid(AB566C61-AF54-11DE-B5BE-00A0D15E9B20), 
        version(1.0),
    
        helpstring("")
      ]
      struct T_DeviceInfo 
      {
        VARIANT_BOOL      probed;           /*!< true if the device capabilities were successfully probed. */
        BSTR              name;             /*!< Character string device identifier. */
        short             outputChannels;   /*!< Maximum output channels supported by device. */
        short             inputChannels;    /*!< Maximum input channels supported by device. */
        short             duplexChannels;   /*!< Maximum simultaneous input/output channels supported by device. */
        VARIANT_BOOL      isDefaultOutput;  /*!< true if this is the default output device. */
        VARIANT_BOOL      isDefaultInput;   /*!< true if this is the default input device. */
        long              nativeFormats;    /*!< Bit mask of supported data formats. */
        SAFEARRAY(short)  sampleRates;      /*!< Supported sample rates (queried from list of standard rates). */
      } T_DeviceInfo;
    
    //-----------------------------------------------------------------------
    
    [
    	object,
    	uuid(AB566C6A-AF54-11DE-B5BE-00A0D15E9B20),
    	oleautomation,
    	nonextensible,
    	helpstring("IFile Interface"),
    	pointer_default(unique)
    ]
    interface IFile : IUnknown
    {
      [propget]HRESULT IsOpen([out, retval] VARIANT_BOOL*);
      [propget]HRESULT FilePosition([out, retval] long*);
      [propget]HRESULT FileLength([out, retval] long*);
      [propget]HRESULT FileEnd([out, retval] VARIANT_BOOL*);
      [propget]HRESULT FileFormatInfo([out, retval] T_AudioFormatInfo*);
      [propget]HRESULT FileSeek([in] long frames, 
                                [in] E_AUDIO_FILE_SEEK_METHOD method,
                                [out, retval] long*);
    };
    
    
    //-----------------------------------------------------------------------
    
    [
    	object,
    	uuid(AB566C6B-AF54-11DE-B5BE-00A0D15E9B20),
    	oleautomation,
    	nonextensible,
    	helpstring("IAudioMixer Interface"),
    	pointer_default(unique)
    ]
    interface IAudioMixer : IUnknown
    {
      [propget]HRESULT MixerLines([out, retval] long*);
      [propget]HRESULT MixerLineName([in] long line, [out, retval] BSTR*);
      [propget]HRESULT MixerLineType([in] long line, [out, retval] long*);
      [propget]HRESULT SelectedMixerLine([out, retval] long*);
      [propget]HRESULT MixerLineVolume([out, retval] long*);
      [propput]HRESULT MixerLineVolume([in] long volume);
    
      HRESULT SelectMixerLine([in] long line, [out, retval] E_AUDIOLIB_RET_VAL*);
    };
    
    //-----------------------------------------------------------------------
    
    [
    	object,
    	uuid(AB566C6C-AF54-11DE-B5BE-00A0D15E9B20),
    	oleautomation,
    	nonextensible,
    	helpstring("IAudioDevice Interface"),
    	pointer_default(unique)
    ]
    interface IAudioDevice : IUnknown
    {
      [propget]HRESULT DeviceId([out, retval] long*);
      [propget]HRESULT DeviceType([out, retval] E_AUDIO_DEV_TYPES*);
      [propget]HRESULT NumOfChannel([out, retval] long*);
      [propget]HRESULT SplitChannel([out, retval] VARIANT_BOOL*);
      [propget]HRESULT DebugMode([out, retval] VARIANT_BOOL*);
      [propput]HRESULT DebugMode([in] VARIANT_BOOL mode);
      [propget]HRESULT FileName([in, defaultvalue(0)] short channel, [out, retval] BSTR*);
      [propput]HRESULT FileName([in] BSTR file_name, [in, defaultvalue(0)] short channel);
      [propget]HRESULT NumBuffers([out, retval] short*);
      [propput]HRESULT NumBuffers([in] short value);
      [propget]HRESULT BufferTimeSize([out, retval] float*);
      [propput]HRESULT BufferTimeSize([in] float value);
      [propget]HRESULT SamplePerSec([out, retval] short*);
      [propput]HRESULT SamplePerSec([in] short value);
      [propget]HRESULT AudioFormat([in] E_AUDIO_FILE_FORMAT*);
      [propput]HRESULT AudioFormat([in] E_AUDIO_FILE_FORMAT value);
      [propget]HRESULT Volume([in, defaultvalue(0)] short channel, [out, retval] long*);
      [propput]HRESULT Volume([in] long, [in, defaultvalue(0)] short channel);
      [propget]HRESULT DeviceStatus([out, retval] E_DEVICE_STATE*);
      [propget]HRESULT ChannelStatus([in, defaultvalue(0)] short channel, [out, retval] E_DEVICE_STATE*);
      [propget]HRESULT AudioMixer([out, retval] IAudioMixer**);
      [propget]HRESULT AudioFile([in, defaultvalue(0)] short channel, [out, retval] IFile**);
      [propget]HRESULT DeviceInfo([out, retval] T_DeviceInfo*);
    
      //METHODS
      HRESULT InitDevice([in] long device_id,
                         [in, defaultvalue(API_UNSPECIFIED)] E_AUDIO_API audio_api,
                         [in, defaultvalue(0)] short num_of_channels,
                         [in, defaultvalue(0)] VARIANT_BOOL split_channel,
                         [out, retval] E_AUDIOLIB_RET_VAL*);
    
      //HRESULT ChangeDevice([out, retval] EAudioLibRetVal*, [in] long new_device_id);
    
      HRESULT CreateStream([in] BSTR key, 
                           [in, defaultvalue(0)] short channel,
                           [out, retval] IWaveStream**);
    
      HRESULT DeleteStream([in] BSTR key, 
                           [in, defaultvalue(0)] short channel);
    
      HRESULT GetActiveStream([in, defaultvalue(0)] short channel,
                              [out, retval] IWaveStream**);
    
      HRESULT SetActiveStream([in] BSTR key, 
                              [in, defaultvalue(0)] short channel);
    };


    I've searched around but I didn't have found a solution.
    I'm using VS2008 with PSDK 6.1

    Cheers,
    Daniele.
    Tuesday, October 6, 2009 5:02 PM

Answers

  • Found it!

    Like always it is a typing mistake:

    Changing the lines:

      [propget]HRESULT FileName([in, defaultvalue(0)] short channel, [out, retval] BSTR*);
      [propput]HRESULT FileName([in] BSTR file_name, [in, defaultvalue(0)] short channel);

    To

      [propget]HRESULT FileName([in, defaultvalue(0)] short channel, [out, retval] BSTR*);
      [propput]HRESULT FileName([in, defaultvalue(0)] short channel, [in] BSTR file_name);

    make it works!
    Daniele.

    • Marked as answer by DBarzo Tuesday, October 6, 2009 5:26 PM
    Tuesday, October 6, 2009 5:25 PM