Quantcast
Channel: Questions in topic: "dllimport"
Viewing all articles
Browse latest Browse all 160

importing C/C++ function from DLL

$
0
0
Hi, I will explain what I want to do exactly and I'd like to know if I need Unity pro. What I read on [that page][1] let me think that yes but I want to be sure. I don't want to pay 100$ if it's not necessary. I want to make a game that uses my own custom device has controller, but first I made a prototype just to be sure that it can work. For now the device is a simple chip that sends a number every 500ms through USB port. I created a C# Dll that will be the interface between the game and the device. So far, I can include and call function from that dll. The problem is that this C# Dll needs to use functions from a C/C++ Dll to read the USB feed. That doesn't seem to work. I'm importing the functions like this: // Import DLL [DllImport("AID.dll")] static extern uint FT_ListDevices(); [DllImport("AID.dll")] static extern uint FT_Open(); [DllImport("AID.dll")] static extern uint FT_Close(); Note that AID.dll also use internally another DLL called FTDI2XX.dll I imported the 3 dll in the asset folder of my unity project (The c# dll and the 2 C/C++ dll) and created a test script that calls the C# dll that calls the AID.dll When I start the game and it comes to access AID.dll functions, I get this error: DllNotFoundException: AID.dll USBTransfer.HardwareComm.startLinking () DLLTest.MyUtilities.StartRead () Test.Start () (at Assets/Test.cs:13) Am I doing something wrong? Is it Unity pro only? Is there a way to do it without Pro? Also, nowhere in the page I referenced above is said where exactly I have to puts my dlls. Is it ok to just put them in the asset folder of should I make them somehow accessible more globally to Unity? Thank you for your help. [1]: http://docs.unity3d.com/Documentation/Manual/Plugins.html

Viewing all articles
Browse latest Browse all 160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>