- Home /
DLL Import => Build finish without Error but Can't Work
At first, I've already confirmed that DLL work well by using C# WPF project. Then I bring those DLL into Unity project, and confirmed "there is no error message".
But the problem is that DLL doesn't work at all.(Function return NULL)
I've tried to modify below configuration options, but the situation doesn't change. (Build Setting→Player Setting→Other Setting →Configuration)
Runtime version : 4.0 -> 3.5 (rebuild but NG)
Scripting Backend : Mono->IL2CPP ( Still NG)
Api Compatibility : 4.0 -> 2.0 (still NG)
Do you have any advice about this problem. Thank you in advance.
=======
My Environment
Unity 2018.4.16f1 personal
Microsoft Visual Studio Community 2019 Version 16.5.1
Windows 10 1903
DLL : Put below DLL files at Asset Folder (from https://www.cypress.com/documentation/software-and-drivers/cysmart-bluetooth-le-test-and-debug-tool)
cybleautobase.dll
cyblecommonbase.dll
cybledonglecommunicator.dll
DLL information (confirmed at VS2019's property window)
Version : 1.3.0.8
Runtime Version: v2.0.50727
=======
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CySmart.Common.Base.Compatibility.Net20;
using CySmart.DongleCommunicator.API;
using System.Runtime.InteropServices.ComTypes;
public class BLErx : MonoBehaviour
{
CyDongleInfo DongleInfo;
CySmartDongleMgr DongleManager;
ICySmartDongleCommunicator Comm;
public void StartBLE()
{
DongleInfo = new CyDongleInfo("COMxx", CyDongleInfo.CySmartDongleType.CY5677);
DongleManager = CySmartDongleMgr.GetInstance();
CyApiErr err = DongleManager.TryGetCySmartDongleCommunicator(DongleInfo, out Comm);
if (err.IsOk)
{
Debug.Log("OK");
}
else
{
Debug.Log("NG");
}
}
}
,
Your answer
![](https://koobas.hobune.stream/wayback/20220612235733im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
DLL import => PlatformNotSupportedException 0 Answers
Connect matlab and unity 0 Answers
[c#] DirectSound in Unity 0 Answers