internal static class BluetoothExports { private static ICOMBluetoothServer m_iBluetoothServer; static BluetoothExports() { //This works fine. ComBridge.RegisterComDll("COMBluetooth.dll", new Guid("3A3C0E65-4ECD-4f8a-A0CC-9509C287375E")); //This is the point where I get exception. m_iBluetoothServer = new CProxyBluetoothClass() as ICOMBluetoothServer; } public static int GetDeviceName(string strDeviceName) { int retValue = 0; retValue = m_iBluetoothServer.GetDeviceName(strDeviceName); return retValue; } } public abstract class Bluetooth : IDisposable { public void TestBluetooth() { string str = ""; BluetoothExports.GetDeviceName(str); } public void Dispose() { } } public class CBluetooth : Bluetooth { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)