com

Using winrt::com_ptr<ID3D11Device1> with D3D11CreateDevice()?

只谈情不闲聊 提交于 2020-12-07 05:14:59
问题 I've been studying the code from the DirectXTK example project and trying to implement it in a new project. It seems like Microsoft recommends using WinRT in new projects, though, so I decided I would try to switch instances of WRL::ComPtr to winrt::com_ptr . I'm stuck, though, trying to move between ID3D11Device1 in the project's Game class and ID3DDevice in D3D11CreateDevice() . Here's the example code, slightly abstracted for simplicity's sake: ComPtr<ID3D11Device1> global_device; void

Can I simplify method signatures I am not using in a ComImport?

℡╲_俬逩灬. 提交于 2020-12-06 19:27:12
问题 I am trying to call GetImageDlg on IWiaDevMgr2 . There are a number of quite complicated methods (which I am not using) referencing a number of types (that I am also not using). As I cannot find a TLB or an IDL from which to automatically generate my ComImport , I would prefer to avoid having to manually translate all of the referenced types. Can I "skip" methods and types by substituting from [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("79C07CF1-CBDD-41ee-8EC3-F00080CADA7A")]

Can I simplify method signatures I am not using in a ComImport?

☆樱花仙子☆ 提交于 2020-12-06 19:26:57
问题 I am trying to call GetImageDlg on IWiaDevMgr2 . There are a number of quite complicated methods (which I am not using) referencing a number of types (that I am also not using). As I cannot find a TLB or an IDL from which to automatically generate my ComImport , I would prefer to avoid having to manually translate all of the referenced types. Can I "skip" methods and types by substituting from [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("79C07CF1-CBDD-41ee-8EC3-F00080CADA7A")]

Can I simplify method signatures I am not using in a ComImport?

一曲冷凌霜 提交于 2020-12-06 19:26:53
问题 I am trying to call GetImageDlg on IWiaDevMgr2 . There are a number of quite complicated methods (which I am not using) referencing a number of types (that I am also not using). As I cannot find a TLB or an IDL from which to automatically generate my ComImport , I would prefer to avoid having to manually translate all of the referenced types. Can I "skip" methods and types by substituting from [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("79C07CF1-CBDD-41ee-8EC3-F00080CADA7A")]

Can I simplify method signatures I am not using in a ComImport?

*爱你&永不变心* 提交于 2020-12-06 19:25:59
问题 I am trying to call GetImageDlg on IWiaDevMgr2 . There are a number of quite complicated methods (which I am not using) referencing a number of types (that I am also not using). As I cannot find a TLB or an IDL from which to automatically generate my ComImport , I would prefer to avoid having to manually translate all of the referenced types. Can I "skip" methods and types by substituting from [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("79C07CF1-CBDD-41ee-8EC3-F00080CADA7A")]

Can I simplify method signatures I am not using in a ComImport?

狂风中的少年 提交于 2020-12-06 19:25:40
问题 I am trying to call GetImageDlg on IWiaDevMgr2 . There are a number of quite complicated methods (which I am not using) referencing a number of types (that I am also not using). As I cannot find a TLB or an IDL from which to automatically generate my ComImport , I would prefer to avoid having to manually translate all of the referenced types. Can I "skip" methods and types by substituting from [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("79C07CF1-CBDD-41ee-8EC3-F00080CADA7A")]

explorer preview causes System.Runtime.InteropServices.COMException: Automation rights are not granted. on ActivePresentation.name

爱⌒轻易说出口 提交于 2020-12-06 06:35:49
问题 public static PowerPoint.Presentation GetActivePPT(this PowerPoint.Application application) { try { if (App.Presentations.Count > 0) { return application.ActivePresentation; } else { return null; } } catch (Exception ex) { return null; } } I call this function like so: PowerPoint.Presentation ppPresentation = PowerPointApplication.GetActivePPT(); if(ppPresentation != null) { Console.WriteLine(ppPresentation.Name); } And I get a : COMException: Message:Presentation (unknown member) : Invalid

explorer preview causes System.Runtime.InteropServices.COMException: Automation rights are not granted. on ActivePresentation.name

a 夏天 提交于 2020-12-06 06:33:30
问题 public static PowerPoint.Presentation GetActivePPT(this PowerPoint.Application application) { try { if (App.Presentations.Count > 0) { return application.ActivePresentation; } else { return null; } } catch (Exception ex) { return null; } } I call this function like so: PowerPoint.Presentation ppPresentation = PowerPointApplication.GetActivePPT(); if(ppPresentation != null) { Console.WriteLine(ppPresentation.Name); } And I get a : COMException: Message:Presentation (unknown member) : Invalid