Skip to content

Commit 4c54a32

Browse files
committed
Work on Interop sample
- Rename folders and solution for clarity. - Update NuGet packages. Signed-off-by: José Simões <jose.simoes@eclo.solutions>
1 parent c9c0682 commit 4c54a32

19 files changed

+19
-39
lines changed

samples/Interop/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ This project illustrates the use of the 'Interop' feature which allow a C# manag
44

55
There are two Solutions in this sample:
66

7-
- In the [*source*](/source) folder you'll find the solution for the Interop managed library: `NF.AwesomeLib.sln`.
8-
- In the [*test-application*](/test-application) folder you'll find the test application that is referencing the Interop library: `Test.Interop.sln`.
7+
- In the [*awesome-library*](awesome-library/) folder you'll find the solution with the Interop library: `NF.AwesomeLib.sln`.
8+
- In the [*test-application*](test-application/) folder you'll find the test application that is referencing the Interop library: `Test.Interop.sln`.
99

10-
:warning: This is an advanced topic. Please read this [blog post](https://jsimoesblog.wordpress.com/2018/06/19/interop-in-net-nanoframework/) with a detailed explanation on how to create, build and use an Interop library.
10+
:warning: This is an advanced topic. :warning:
11+
12+
Please read this [blog post](https://jsimoesblog.wordpress.com/2018/06/19/interop-in-net-nanoframework/) with a detailed explanation on how to create, build and use an Interop library.
1113

1214
> **Note:** This sample is part of a large collection of nanoFramework feature samples.
1315
> If you are unfamiliar with Git and GitHub, you can download the entire collection as a

samples/Interop/source/NF.AwesomeLib.nfproj renamed to samples/Interop/awesome-library/NF.AwesomeLib.nfproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<Compile Include="Utilities.cs" />
2828
</ItemGroup>
2929
<ItemGroup>
30-
<Reference Include="mscorlib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
31-
<HintPath>packages\nanoFramework.CoreLibrary.1.0.0-preview054\lib\mscorlib.dll</HintPath>
30+
<Reference Include="mscorlib, Version=1.2.6.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
31+
<HintPath>packages\nanoFramework.CoreLibrary.1.2.6-preview.19\lib\mscorlib.dll</HintPath>
3232
<Private>True</Private>
3333
<SpecificVersion>True</SpecificVersion>
3434
</Reference>
File renamed without changes.

samples/Interop/source/Properties/AssemblyInfo.cs renamed to samples/Interop/awesome-library/Properties/AssemblyInfo.cs

File renamed without changes.

samples/Interop/source/Stubs/FindINTEROP-NF.AwesomeLib.cmake renamed to samples/Interop/awesome-library/Stubs/FindINTEROP-NF.AwesomeLib.cmake

File renamed without changes.

samples/Interop/source/Stubs/NF_AwesomeLib.cpp renamed to samples/Interop/awesome-library/Stubs/NF_AwesomeLib.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_NF_AwesomeLib =
2525
"NF.AwesomeLib",
2626
0xBB94F141,
2727
method_lookup,
28+
////////////////////////////////////////////////////////////////////////////////////
29+
// check if the version bellow matches the one in AssemblyNativeVersion attribute //
30+
////////////////////////////////////////////////////////////////////////////////////
2831
{ 1, 0, 0, 0 }
2932
};

samples/Interop/source/Stubs/NF_AwesomeLib.h renamed to samples/Interop/awesome-library/Stubs/NF_AwesomeLib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define _NF_AWESOMELIB_H_
1212

1313
#include <nanoCLR_Interop.h>
14+
#include <nanoCLR_Runtime.h>
1415
struct Library_NF_AwesomeLib_NF_AwesomeLib_Math
1516
{
1617
NANOCLR_NATIVE_DECLARE(NativeSuperComplicatedCalculation___STATIC__R8__R8);

samples/Interop/source/Stubs/NF_AwesomeLib_NF_AwesomeLib_Math.cpp renamed to samples/Interop/awesome-library/Stubs/NF_AwesomeLib_NF_AwesomeLib_Math.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,14 @@
99
// re-run.
1010
//
1111
//-----------------------------------------------------------------------------
12-
13-
1412
#include "NF_AwesomeLib.h"
1513
#include "NF_AwesomeLib_NF_AwesomeLib_Math.h"
1614

1715
using namespace NF::AwesomeLib;
1816

1917
double Math::NativeSuperComplicatedCalculation( double param0, HRESULT &hr )
2018
{
21-
(void)hr;
22-
2319
double retVal = 0;
24-
retVal = param0 + 1;
2520
return retVal;
2621
}
2722

samples/Interop/source/Stubs/NF_AwesomeLib_NF_AwesomeLib_Math.h renamed to samples/Interop/awesome-library/Stubs/NF_AwesomeLib_NF_AwesomeLib_Math.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// re-run.
1010
//
1111
//-----------------------------------------------------------------------------
12-
13-
1412
#ifndef _NF_AWESOMELIB_NF_AWESOMELIB_MATH_H_
1513
#define _NF_AWESOMELIB_NF_AWESOMELIB_MATH_H_
1614

0 commit comments

Comments
 (0)