Added demo for cpp module and updated the CppModule

This commit is contained in:
2025-06-24 22:11:15 +03:00
parent 89385a8c89
commit 962d813466
16 changed files with 304 additions and 62 deletions

View File

@@ -0,0 +1,19 @@
using System.Runtime.InteropServices;
namespace CppModuleDemo;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct ExampleComplexObject
{
public int IntegerValue;
public double DoubleValue;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string StringValue;
public ExampleComplexObject(int integerValue, double doubleValue, string stringValue)
{
IntegerValue = integerValue;
DoubleValue = doubleValue;
StringValue = stringValue;
}
}