Add SystemFileDialog utility with native integration #90

Merged
rnetiks merged 3 commits from master into master 2025-10-15 14:44:55 +00:00
rnetiks commented 2025-10-13 08:23:07 +00:00 (Migrated from github.com)

Introduced a new SystemFileDialog utility to enable native file dialog functionality using a C++ helper dynamic library. Updated project solution files to include the Helper project and integrated its functionality with a C# wrapper for easier usage within the solution.

Introduced a new SystemFileDialog utility to enable native file dialog functionality using a C++ helper dynamic library. Updated project solution files to include the Helper project and integrated its functionality with a C# wrapper for easier usage within the solution.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-13 11:34:07 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR adds a new SystemFileDialog utility that provides native Windows file dialog functionality through C++ interop. It introduces a complete solution with both C++ native implementation and C# wrapper for easier integration.

  • Adds a new C++ dynamic library (Helper) that implements native Windows file dialogs using COM interfaces
  • Creates a C# wrapper class (SystemFileDialog) with P/Invoke declarations to interface with the native library
  • Updates project solution to include the Helper C++ project and compile the new utility class

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Shared.Core/Utilities/SystemFileDialog.cs C# wrapper class with P/Invoke declarations and FOS enum for native file dialog functionality
src/Shared.Core/Shared.Core.projitems Adds the new SystemFileDialog.cs to the compilation list
src/KKAPI.sln Includes the new Helper C++ project in the solution with build configurations
src/Helper/SystemFileDialog.cpp C++ implementation with exported functions for creating and displaying native file dialogs
src/Helper/Helper.vcxproj.filters Visual Studio project filters file for organizing the Helper project
src/Helper/Helper.vcxproj Visual Studio C++ project configuration for building the Helper dynamic library

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR adds a new SystemFileDialog utility that provides native Windows file dialog functionality through C++ interop. It introduces a complete solution with both C++ native implementation and C# wrapper for easier integration. - Adds a new C++ dynamic library (Helper) that implements native Windows file dialogs using COM interfaces - Creates a C# wrapper class (SystemFileDialog) with P/Invoke declarations to interface with the native library - Updates project solution to include the Helper C++ project and compile the new utility class ### Reviewed Changes Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | src/Shared.Core/Utilities/SystemFileDialog.cs | C# wrapper class with P/Invoke declarations and FOS enum for native file dialog functionality | | src/Shared.Core/Shared.Core.projitems | Adds the new SystemFileDialog.cs to the compilation list | | src/KKAPI.sln | Includes the new Helper C++ project in the solution with build configurations | | src/Helper/SystemFileDialog.cpp | C++ implementation with exported functions for creating and displaying native file dialogs | | src/Helper/Helper.vcxproj.filters | Visual Studio project filters file for organizing the Helper project | | src/Helper/Helper.vcxproj | Visual Studio C++ project configuration for building the Helper dynamic library | </details> --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/IllusionMods/IllusionModdingAPI/new/master/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
@ -0,0 +15,4 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-13 11:34:06 +00:00

The project filters file references 'dllmain.cpp' but the actual source file in the project is 'SystemFileDialog.cpp'. This mismatch will cause build issues.

    <ClCompile Include="SystemFileDialog.cpp">
The project filters file references 'dllmain.cpp' but the actual source file in the project is 'SystemFileDialog.cpp'. This mismatch will cause build issues. ```suggestion <ClCompile Include="SystemFileDialog.cpp"> ```
@ -0,0 +165,4 @@
}
/**
* Creates and displays an save file dialog with the specified parameters.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-13 11:34:07 +00:00

Corrected grammar from 'an save file dialog' to 'a save file dialog'.

 * Creates and displays a save file dialog with the specified parameters.
Corrected grammar from 'an save file dialog' to 'a save file dialog'. ```suggestion * Creates and displays a save file dialog with the specified parameters. ```
@ -79,6 +81,10 @@ Global
{C275954F-05F9-4AFF-8290-E8190B54A602}.Debug|Any CPU.Build.0 = Debug|Any CPU
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-13 11:34:07 +00:00

The C++ Helper project is configured to build as Win32 (32-bit) when the solution platform is 'Any CPU'. This could cause architecture mismatch issues. Consider adding x64 configurations to support 64-bit builds.

		{240874A0-0873-4EA1-BC5D-350B09EB1182}.Release|Any CPU.Build.0 = Release|Win32
		{240874A0-0873-4EA1-BC5D-350B09EB1182}.Debug|x64.ActiveCfg = Debug|x64
		{240874A0-0873-4EA1-BC5D-350B09EB1182}.Debug|x64.Build.0 = Debug|x64
		{240874A0-0873-4EA1-BC5D-350B09EB1182}.Release|x64.ActiveCfg = Release|x64
		{240874A0-0873-4EA1-BC5D-350B09EB1182}.Release|x64.Build.0 = Release|x64
The C++ Helper project is configured to build as Win32 (32-bit) when the solution platform is 'Any CPU'. This could cause architecture mismatch issues. Consider adding x64 configurations to support 64-bit builds. ```suggestion {240874A0-0873-4EA1-BC5D-350B09EB1182}.Release|Any CPU.Build.0 = Release|Win32 {240874A0-0873-4EA1-BC5D-350B09EB1182}.Debug|x64.ActiveCfg = Debug|x64 {240874A0-0873-4EA1-BC5D-350B09EB1182}.Debug|x64.Build.0 = Debug|x64 {240874A0-0873-4EA1-BC5D-350B09EB1182}.Release|x64.ActiveCfg = Release|x64 {240874A0-0873-4EA1-BC5D-350B09EB1182}.Release|x64.Build.0 = Release|x64 ```
rnetiks (Migrated from github.com) reviewed 2025-10-13 12:25:23 +00:00
@ -0,0 +15,4 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
rnetiks (Migrated from github.com) commented 2025-10-13 12:25:23 +00:00

SystemFileDialog.cpp should probably be renamed to dllmain, rather than vice versa giving how it's the entry point

SystemFileDialog.cpp should probably be renamed to dllmain, rather than vice versa giving how it's the entry point
rnetiks (Migrated from github.com) reviewed 2025-10-13 12:25:35 +00:00
@ -0,0 +165,4 @@
}
/**
* Creates and displays an save file dialog with the specified parameters.
rnetiks (Migrated from github.com) commented 2025-10-13 12:25:34 +00:00

Oh yay, typos....

Oh yay, typos....
rnetiks (Migrated from github.com) reviewed 2025-10-13 12:26:26 +00:00
@ -79,6 +81,10 @@ Global
{C275954F-05F9-4AFF-8290-E8190B54A602}.Debug|Any CPU.Build.0 = Debug|Any CPU
rnetiks (Migrated from github.com) commented 2025-10-13 12:26:26 +00:00

Now entirely sure about this one? x86 should work for both 32bit and 64bit? Needs further testing.

Now entirely sure about this one? x86 should work for both 32bit and 64bit? Needs further testing.
rnetiks (Migrated from github.com) reviewed 2025-10-13 12:38:55 +00:00
@ -79,6 +81,10 @@ Global
{C275954F-05F9-4AFF-8290-E8190B54A602}.Debug|Any CPU.Build.0 = Debug|Any CPU
rnetiks (Migrated from github.com) commented 2025-10-13 12:38:55 +00:00

tldr; No. Koi is a x64 process, as such it can't load x86, resolved in latest commit

tldr; No. Koi is a x64 process, as such it can't load x86, resolved in latest commit
rnetiks (Migrated from github.com) reviewed 2025-10-13 12:41:38 +00:00
@ -0,0 +165,4 @@
}
/**
* Creates and displays an save file dialog with the specified parameters.
rnetiks (Migrated from github.com) commented 2025-10-13 12:41:38 +00:00

You leave my typos alone stupid bot. My engrish is feri gut.

You leave my typos alone stupid bot. My engrish is feri gut.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IllusionMods/IllusionModdingAPI!90
No description provided.