我正在使用 DLL 中定义的接口。
当我打电话...
m.GetMasterVolumeLevelScalar(btVol)
...我得到一个空引用异常,因为“m”什么都不是。
但是,我不能在这个界面上使用“new”。
我将如何正确使用这个界面?
我确实阅读了工具,但我没有找到与此接口类似的示例。
谢谢你。
编辑:我现在知道我需要输入
Implements Vannatech.CoreAudio.Interfaces.IAudioEndpointVolume
并且这些功能将自动添加到我的班级中。
但是,我不确定如何处理 NonImplementedException 例如这里:
Public Function GetMasterVolumeLevelScalar(ByRef level As Single) As Integer Implements IAudioEndpointVolume.GetMasterVolumeLevelScalar
Throw New NotImplementedException()
End Function
我知道了:
我只需要输入
Implements Vannatech.CoreAudio.Interfaces.IAudioEndpointVolume
通过这样做,所有函数都将自动添加到我输入它的类中。
我只是没有向下滚动到足以看到它。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句