Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CsWin32 usage sample #7929

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Commits on Jun 15, 2023

  1. CsWin32 usage sample

    This is a draft to drive the conversation around utilizing CsWin32 in WPF. In it I've converted SplashScreen to use CsWin32 and directly utilize WIC pointers.
    
    This is informed by WinForms transition and utilizes some of the code, notably ComScope and IID. There is more support code that WinForms uses that eases handling of COM situations, including providing ComWrapper based "CCWs" for managed classes.
    
    WinForms also contains other patterns for scoping handles, handling GC keep-alive scenarios, and managing agiile COM pointers and VARIANT interop.
    
    As CsWin32 types Win32 typedefs (such as HWND, and HRESULT) it can get very awkward to exchange these if you use CsWin32 directly in multiple assemblies in the assembly graph. As such I created a new shared assembly for the interop code.
    
    I added a batch file to simplify Visual Studio in the right context (copied from WinForms).
    
    Choices here were expedient and made with the goal of illustrating how to do this. I have not tested anything outside of ensuring compilation works.
    JeremyKuhne committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    3e6fc9a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d695aae View commit details
    Browse the repository at this point in the history