When you say multiple stacks, you mean I can use multiple DIFFERENT stacks or multiple instances of the same stack (Many BT dongles using MS Stacks)?
When I start my program with the BT dongle not connected I have an exception in the folowing code: (maybe you can identify the problem)
try {
Type t = Type.GetType(factoryName);
object tmp;
try {
tmp = Activator.CreateInstance(t);
} catch (System.Reflection.TargetInvocationException tiex) {
throw tiex.InnerException;
}
Debug.Assert(tmp != null, "Expect all failures to throw rather than return null.");
list.Add((BluetoothFactory)tmp); //s_factory = (BluetoothFactory)tmp;
if (BluetoothFactoryConfig.OneStackOnly) {
break;
}
} catch (PlatformNotSupportedException) {
} catch (Exception ex) {
// This isn't actually true, the factories thrown any old exception!
Debug.Assert(TestUtilities.IsUnderTestHarness(), string.Format(System.Globalization.CultureInfo.InvariantCulture,
"Unexpected exception creating factory '{0}, ex: {1}", factoryName, ex));
}
Exception (StackTrace)
at BluetoothFactory.GetStacks_inLock() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(55)
at BluetoothFactory.get_Factories() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(76)
at BluetoothFactory.get_Factory() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(90)
at BluetoothRadio.get_PrimaryRadio() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothRadio.cs(58)
at Search.controlSearch() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\Search.cs(133)
at ThreadHelper.ThreadStart_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at ThreadHelper.ThreadStart()
Unexpected exception creating factory 'InTheHand.Net.Bluetooth.Widcomm.WidcommBluetoothFactory, ex: System.InvalidOperationException: May only be one instance of WidcommBtIf.
em InTheHand.Net.Bluetooth.BluetoothFactory.GetStacks_inLock() na C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs:linha 45
at BluetoothFactory.GetStacks_inLock() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(55)
at BluetoothFactory.get_Factories() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(76)
at BluetoothFactory.get_Factory() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(90)
at BluetoothRadio.get_PrimaryRadio() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothRadio.cs(58)
at Send.controlSend(Object tDbConnId) C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\Send.cs(121)
at ThreadHelper.ThreadStart_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at ThreadHelper.ThreadStart(Object obj)
Unexpected exception creating factory 'InTheHand.Net.Bluetooth.Widcomm.WidcommBluetoothFactory, ex: System.InvalidOperationException: May only be one instance of WidcommBtIf.
em InTheHand.Net.Bluetooth.BluetoothFactory.GetStacks_inLock() na C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs:linha 45
---- Declarar Mensagem Detalhada ----
at BluetoothFactory.GetStacks_inLock() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(55)
at BluetoothFactory.get_Factories() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(76)
at BluetoothFactory.get_Factory() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(90)
at BluetoothRadio.get_PrimaryRadio() C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothRadio.cs(58)
at Send.controlSend(Object tDbConnId) C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\Send.cs(121)
at ThreadHelper.ThreadStart_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at ThreadHelper.ThreadStart(Object obj)
The program '[7316] BluesysTooth.vshost.exe: Managed' has exited with code 0 (0x0).