Closed selastingeorge closed 3 years ago
I think it may be due to what's described here: https://stackoverflow.com/questions/61527633/wrong-vtable-generated-by-c-compiler-for-com-object
Many DComp interfaces have members with the same name but with different arguments, for example: IDCompositionRectangleClip
's SetLeft
has two "overloads".
You can try to redefine them manually (invert members) just to check if it works better, ie:
[ComImport, Guid("9842ad7d-d9cf-4908-aed7-48b51da5e7c2"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public partial interface IDCompositionRectangleClip : IDCompositionClip
{
// IDCompositionClip
// IDCompositionRectangleClip
[PreserveSig]
HRESULT SetLeft(/* THIS_ _In_ */ IDCompositionAnimation animation);
[PreserveSig]
HRESULT SetLeft(float left);
...
}
Note other notable interop projects have the same issue (but they are not even aware): https://github.com/microsoft/win32metadata
PS: you should use the newer WinRT's Windows.UI.Composition, it's much easier to use in .NET, you won't face this issue, and you don't need DirectN.
Thank you for helping.
I have been porting a C++ direct composition Code to CS, In my C++ code I use
IDCompositionRectangleClip
to clip the visual, it is working fine with C++, when I am trying to implement it in CS using DirectN, the visual Disappears.in C++ I used :
The C# Code I Used:
This is how my Window looks like before clipping:
After Clipping the entire visual is missing, and only the window frame is visible:
Edited:
It's not only the RectangleClip not working, i tried
SetOffsetX()
method of the root Visual it is also having issues, the offset is not set.(in the code below i haven't used the rectangle clip just offset)
Here is the complete code i used to set offset: