|
Now I writing a simple program with c# and bulding .DLL (This is the c#) using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.Collections; using System.Timers; namespace TestDll { public class TestClass { Queue myQueue = new Queue(); private System.Timers.Timer timerA; int direction = 0; } And I put it(DLL) to Unity to test plugins. I create a c# to import the function in Unity. using UnityEngine; using System.Collections; using System; using System.Runtime.InteropServices; public class PluginsTest : MonoBehaviour { } But when I play...Unity say.... EntryPointNotFoundException: iNowMiliSec PluginsTest.Start () (at Assets/PluginsTest/Script/PluginsTest.cs:12) so...where I miss or wrong??
(comments are locked)
|
|
You shouldn't have to use DllImport for managed dlls, but unmanaged dlls. In order to use your TestDll.dll, copy it to Unity as you've done. Then your code that uses it should look something like this: wow!! It's working!! Thank you a lot!! And can I ask something about you say? What is you say "managed dlls"? Why it can't be use? And what is unmanaged dlls? Sorry to ask so many... You can teach me more?
Dec 13 '11 at 03:19 PM
ZroeX
Managed code is code that runs in .NET or MONO framework. It's code that is compiled into IL. Basically VB .NET, C#, Managed C++ and other ".NET languages" are managed. Unmanaged code is also known as native code, and is code that have been compiled into machine instructions (Native C++/C and other languages). You are using your managed DLL by including it in the project and using the namespace declared inside it. Unmanaged code has to be dynamically loaded, bound to and conform to special calling conventions unless defined otherwise. Long story short (and simplified): Only use DllImport if you have a typical C++ dll that you want to use.
Dec 13 '11 at 03:23 PM
Statement ♦♦
Dec 13 '11 at 03:24 PM
Statement ♦♦
(comments are locked)
|
