com

Get an audio session's volume level

孤街浪徒 提交于 2021-02-07 09:23:19
问题 Does anyone know how to get the current volume level of an audio session* in Vista or 7? I've got the IAudioSessionControl2 and IAudioSessionManager2 instances you need to listen for volume changes , but actually getting the current volume is proving elusive. *by audio session I mean (roughly) the per-application audio control, not the "master" one Note that (so far as I can tell) IAudioSessionManager2->GetSimpleVolume() isn't the right answer here. The only thing that publishes a GUID in

Access .NET generic objects from VBA

血红的双手。 提交于 2021-02-07 09:16:28
问题 My .net code has an object with a number of generic properties. This object is returned to the VBA code. All the non-generic properties are working well, but I also need to access the generic values. Is there a way to do it from VBA? [ClassInterface(ClassInterfaceType.AutoDual)] public class Obj { public string GetProp1() {...} public IList<MyCustomType> GetProp2() {...} } VB code: Sub Test() Dim o As Program.Obj Set o = New Program.Obj Set p2 = hp.GetProp2() set p2_0 = p2(0) ' doesn't work

Access .NET generic objects from VBA

穿精又带淫゛_ 提交于 2021-02-07 09:14:09
问题 My .net code has an object with a number of generic properties. This object is returned to the VBA code. All the non-generic properties are working well, but I also need to access the generic values. Is there a way to do it from VBA? [ClassInterface(ClassInterfaceType.AutoDual)] public class Obj { public string GetProp1() {...} public IList<MyCustomType> GetProp2() {...} } VB code: Sub Test() Dim o As Program.Obj Set o = New Program.Obj Set p2 = hp.GetProp2() set p2_0 = p2(0) ' doesn't work

Good techniques for keeping COM classes that implement multiple interfaces manageable

廉价感情. 提交于 2021-02-07 04:24:15
问题 COM objects that implement many interfaces can end up suffering from the god object anti-pattern or end up full of tedious forwarding code: class MyCOMClass , public CUnknown , public IFoo , public IBar , public IPersistStream , public IYetAnotherInterface, , public IAndAnotherInterfaceToo // etc etc etc In the most obvious implementation, the class MyCOMClass ends up implementing all the interfaces internally, becomes very large and coupled to details of implementation of each interface.

Setting an Excel Range with an Array using Python and comtypes?

我的梦境 提交于 2021-02-07 03:49:39
问题 Using comtypes to drive Python, it seems some magic is happening behind the scenes that is not converting tuples and lists to VARIANT types: # RANGE(“C14:D21”) has values # Setting the Value on the Range with a Variant should work, but # list or tuple is not getting converted properly it seems >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Open(r'C:\temp\my_file.xlsx') >>>xl.Visible = True >>>vals=tuple([(x,y) for x,y in zip('abcdefgh'

Setting an Excel Range with an Array using Python and comtypes?

我怕爱的太早我们不能终老 提交于 2021-02-07 03:48:38
问题 Using comtypes to drive Python, it seems some magic is happening behind the scenes that is not converting tuples and lists to VARIANT types: # RANGE(“C14:D21”) has values # Setting the Value on the Range with a Variant should work, but # list or tuple is not getting converted properly it seems >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Open(r'C:\temp\my_file.xlsx') >>>xl.Visible = True >>>vals=tuple([(x,y) for x,y in zip('abcdefgh'

Setting an Excel Range with an Array using Python and comtypes?

爱⌒轻易说出口 提交于 2021-02-07 03:48:18
问题 Using comtypes to drive Python, it seems some magic is happening behind the scenes that is not converting tuples and lists to VARIANT types: # RANGE(“C14:D21”) has values # Setting the Value on the Range with a Variant should work, but # list or tuple is not getting converted properly it seems >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Open(r'C:\temp\my_file.xlsx') >>>xl.Visible = True >>>vals=tuple([(x,y) for x,y in zip('abcdefgh'

Setting an Excel Range with an Array using Python and comtypes?

淺唱寂寞╮ 提交于 2021-02-07 03:47:57
问题 Using comtypes to drive Python, it seems some magic is happening behind the scenes that is not converting tuples and lists to VARIANT types: # RANGE(“C14:D21”) has values # Setting the Value on the Range with a Variant should work, but # list or tuple is not getting converted properly it seems >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Open(r'C:\temp\my_file.xlsx') >>>xl.Visible = True >>>vals=tuple([(x,y) for x,y in zip('abcdefgh'

Registration-Free COM Interop and Dependent Assemblies

亡梦爱人 提交于 2021-02-07 02:50:30
问题 We are working on an integration of a large MFC-based application with a handful of managed (.NET) add-ins. Communication with these add-ins is done via COM. Historically, we've just used the registry to make these add-ins available (as COM servers) to the application. But, now we're trying to use registration-free COM interop to do this. We'd like these add-ins to be able to live in a separate directory from the one that the application is running in -- ideally anywhere. But, we're

Registration-Free COM Interop and Dependent Assemblies

狂风中的少年 提交于 2021-02-07 02:50:05
问题 We are working on an integration of a large MFC-based application with a handful of managed (.NET) add-ins. Communication with these add-ins is done via COM. Historically, we've just used the registry to make these add-ins available (as COM servers) to the application. But, now we're trying to use registration-free COM interop to do this. We'd like these add-ins to be able to live in a separate directory from the one that the application is running in -- ideally anywhere. But, we're