Hello everyone.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Options
Hololens cannot pinvoke native dll with error "Dll Not Found"
Hi,
I tried to build a very simple native dll that can be called by a simple UWP c# app with PInvoke. The UWP app can run on normal Windows 10 computer without any problem, but when I deployed the UWP app to a Hololens, it always fails with error "Dll Not Found". I have tested RS4 and RS5 in Hololens and got the same result.
The reproduce steps are very straightforward.
- Create a native C++ DLL project ( I am using VS 2017 community version), and write some code like returning 1 + 2, for example:
include "stdafx.h"
extern "C" {
__declspec(dllexport) int __stdcall add12() { return 1 + 2; }
}
- Create a blank UWP project to call the DLL function with PInvoke:
public class WrapperClass
{
[DllImport("CPPDLL", CallingConvention = CallingConvention.StdCall)]
public static extern int add12();
}
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
int result = WrapperClass.add12(); Debug.WriteLine("add 12 = " + result); } }
- Build and run the UWP application on a Win10 computer and a Hololens, and you will notice that the Win10 computer will succeed to run while the Hololens will fail to run.
Any help is highly appreciated.
Thanks,
Bin
Tagged:
0
Best Answer
-
OptionsBinXie ✭
Got the answer from somewhere else. The problem is about dll dependency. Question closed.
0
Answers
Got the answer from somewhere else. The problem is about dll dependency. Question closed.
BinXie Could you share how you solved it?
I got the same problem and Did you refer to this https://social.msdn.microsoft.com/Forums/windowsapps/en-US/26013e5e-3ff1-44a0-8797-0474dabd12d0/uwpincluding-dlls-in-a-uwp-application-in-visual-studio?forum=wpdevelop?
Cause I have no Idea how to do the dependency thing after read that thread. Cause I have no option for package dependency in appxmanifest.