I am trying to make a very simple greeting world for Pinvoke and native calls.
I am creating one solution with two projects (one for dll and one for universal Windows application)

So I get a heirachy project like this

There is one method in my dll (NativeCalls.cpp file):
#include "pch.h"
#include "NativeCalls.h"
#include <stdio.h>
MYAPI void print_line(const char* str) {
printf("%s\n", str);
}
On the C # side of things, I have a NativeCalls.cs file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace MSSurfaceHubMonitoring
{
public static class NativeCalls
{
[DllImport("NativeCalls.dll")]
private static extern void print_line(string str);
public static void sayHelo()
{
print_line("Hello, PInvoke!");
}
}
}
At this point I will build and run it, but get an error message that it cannot find the dll

However, I believe this is a dependency, not a dll. I changed the output directory of the DLL to be at the root of where the UW application starts from (\ bin \ x86), so it really should find it. So, as I said, I think these are dependencies, not the actual dll.
Dependency Walker
++, , , . , .
FYI
dll UW. , ? , , , , DLL , . , , :
