Skip to content

Commit e040498

Browse files
committed
Sync with latest ReClass.NET source.
Upgraded projects to VS2019.
1 parent 864ef07 commit e040498

6 files changed

+32
-28
lines changed

Hybrid/SamplePluginHybrid.rc

2 Bytes
Binary file not shown.

Hybrid/SamplePluginHybrid.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,34 @@
2323
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
2424
<Keyword>ManagedCProj</Keyword>
2525
<RootNamespace>SamplePluginHybrid</RootNamespace>
26-
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>DynamicLibrary</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v141</PlatformToolset>
32+
<PlatformToolset>v142</PlatformToolset>
3333
<CLRSupport>true</CLRSupport>
3434
<CharacterSet>Unicode</CharacterSet>
3535
</PropertyGroup>
3636
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3737
<ConfigurationType>DynamicLibrary</ConfigurationType>
3838
<UseDebugLibraries>false</UseDebugLibraries>
39-
<PlatformToolset>v141</PlatformToolset>
39+
<PlatformToolset>v142</PlatformToolset>
4040
<CLRSupport>true</CLRSupport>
4141
<CharacterSet>Unicode</CharacterSet>
4242
</PropertyGroup>
4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4444
<ConfigurationType>DynamicLibrary</ConfigurationType>
4545
<UseDebugLibraries>true</UseDebugLibraries>
46-
<PlatformToolset>v141</PlatformToolset>
46+
<PlatformToolset>v142</PlatformToolset>
4747
<CLRSupport>true</CLRSupport>
4848
<CharacterSet>Unicode</CharacterSet>
4949
</PropertyGroup>
5050
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5151
<ConfigurationType>DynamicLibrary</ConfigurationType>
5252
<UseDebugLibraries>false</UseDebugLibraries>
53-
<PlatformToolset>v141</PlatformToolset>
53+
<PlatformToolset>v142</PlatformToolset>
5454
<CLRSupport>true</CLRSupport>
5555
<CharacterSet>Unicode</CharacterSet>
5656
</PropertyGroup>

Hybrid/SamplePluginHybridExt.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@ namespace SamplePluginHybrid
77
{
88
this->host = host;
99

10-
// Register a node info reader to display custom data on nodes.
11-
reader = gcnew SampleNodeInfoReader;
12-
13-
host->RegisterNodeInfoReader(reader);
14-
1510
return true;
1611
}
1712

1813
/// <summary>This method gets called when ReClass.NET unloads the plugin.</summary>
1914
void SamplePluginHybridExt::Terminate()
2015
{
21-
host->DeregisterNodeInfoReader(reader);
22-
2316
host = nullptr;
2417
}
2518

19+
IReadOnlyList<INodeInfoReader^>^ SamplePluginHybridExt::GetNodeInfoReaders()
20+
{
21+
// Register a node info reader to display custom data on nodes.
22+
23+
auto reader = gcnew List<INodeInfoReader^>();
24+
reader->Add(gcnew SampleNodeInfoReader);
25+
return reader;
26+
}
27+
2628
/// <summary>This method lets ReClass.NET print the name and the value of the node.</summary>
27-
String^ SampleNodeInfoReader::ReadNodeInfo(BaseNode^ node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer^ memory)
29+
String^ SampleNodeInfoReader::ReadNodeInfo(BaseHexCommentNode^ node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer^ memory)
2830
{
2931
return node->Name + "@" + nodeAddress.ToString("X") + " => " + nodeValue.ToString("X");
3032
}

Hybrid/SamplePluginHybridExt.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
using namespace System;
4+
using namespace System::Collections::Generic;
45
using namespace ReClassNET;
56
using namespace ReClassNET::Memory;
67
using namespace ReClassNET::Nodes;
@@ -15,6 +16,7 @@ namespace SamplePluginHybrid
1516
public:
1617
virtual bool Initialize(IPluginHost^ host) override;
1718
virtual void Terminate() override;
19+
virtual IReadOnlyList<INodeInfoReader^>^ GetNodeInfoReaders() override;
1820

1921
private:
2022
IPluginHost^ host;
@@ -24,6 +26,6 @@ namespace SamplePluginHybrid
2426
public ref class SampleNodeInfoReader : INodeInfoReader
2527
{
2628
public:
27-
virtual String^ ReadNodeInfo(BaseNode^ node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer^ memory);
29+
virtual String^ ReadNodeInfo(BaseHexCommentNode^ node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer^ memory);
2830
};
2931
}

Managed/SamplePluginManagedExt.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Drawing;
34
using System.Linq;
45
using System.Windows.Forms;
@@ -15,7 +16,6 @@ namespace SamplePluginManaged
1516
public class SamplePluginManagedExt : Plugin
1617
{
1718
private IPluginHost host;
18-
private INodeInfoReader reader;
1919

2020
/// <summary>The icon to display in the plugin manager form.</summary>
2121
public override Image Icon => null;
@@ -28,11 +28,6 @@ public override bool Initialize(IPluginHost host)
2828
// Notfiy the plugin if a window is shown.
2929
GlobalWindowManager.WindowAdded += OnWindowAdded;
3030

31-
// Register a node info reader to display custom data on nodes.
32-
reader = new SampleNodeInfoReader();
33-
34-
host.RegisterNodeInfoReader(reader);
35-
3631
return true;
3732
}
3833

@@ -41,13 +36,18 @@ public override void Terminate()
4136
{
4237
// Clean up what you have registered.
4338

44-
host.DeregisterNodeInfoReader(reader);
45-
4639
GlobalWindowManager.WindowAdded -= OnWindowAdded;
4740

4841
host = null;
4942
}
5043

44+
public override IReadOnlyList<INodeInfoReader> GetNodeInfoReaders()
45+
{
46+
// Register a node info reader to display custom data on nodes.
47+
48+
return new[] { new SampleNodeInfoReader() };
49+
}
50+
5151
/// <summary>
5252
/// This method gets called when a new windows is opened.
5353
/// You can use this function to add a settings panel into the settings dialog for example.
@@ -97,7 +97,7 @@ private void OnWindowAdded(object sender, GlobalWindowManagerEventArgs e)
9797
public class SampleNodeInfoReader : INodeInfoReader
9898
{
9999
/// <summary>This method lets ReClass.NET print the name and the value of the node.</summary>
100-
public string ReadNodeInfo(BaseNode node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer memory)
100+
public string ReadNodeInfo(BaseHexCommentNode node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer memory)
101101
{
102102
return $"{node.Name}@{nodeAddress.ToString("X")} => {nodeValue.ToString("X")}";
103103
}

Native/SamplePlugin.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,33 @@
2222
<ProjectGuid>{22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}</ProjectGuid>
2323
<Keyword>Win32Proj</Keyword>
2424
<RootNamespace>SamplePlugin</RootNamespace>
25-
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2626
<ProjectName>SamplePluginNative</ProjectName>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>DynamicLibrary</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v141</PlatformToolset>
32+
<PlatformToolset>v142</PlatformToolset>
3333
<CharacterSet>MultiByte</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>DynamicLibrary</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v141</PlatformToolset>
38+
<PlatformToolset>v142</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>MultiByte</CharacterSet>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4343
<ConfigurationType>DynamicLibrary</ConfigurationType>
4444
<UseDebugLibraries>true</UseDebugLibraries>
45-
<PlatformToolset>v141</PlatformToolset>
45+
<PlatformToolset>v142</PlatformToolset>
4646
<CharacterSet>MultiByte</CharacterSet>
4747
</PropertyGroup>
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>DynamicLibrary</ConfigurationType>
5050
<UseDebugLibraries>false</UseDebugLibraries>
51-
<PlatformToolset>v141</PlatformToolset>
51+
<PlatformToolset>v142</PlatformToolset>
5252
<WholeProgramOptimization>true</WholeProgramOptimization>
5353
<CharacterSet>MultiByte</CharacterSet>
5454
</PropertyGroup>

0 commit comments

Comments
 (0)