I'm experiencing some rather curious behavior. I started with the BluetoothClientDemo form and modified it to be a simple class that is called from a console program.
wclErrors.wclShowError(wclClient.Write(Buf, (uint)str.Length)); // WORKS
var result = wclClient.Write(Buf, (uint) str.Length);
wclErrors.wclShowError(result); // ALSO WORKS
var result = wclClient.Write(Buf, (uint) str.Length);
wclErrors.wclShowError(0); // DOES NOT WORK - I'M JUST SENDING IN 0
Console.WriteLine(wclClient.Write(Buf, (uint) str.Length)); // DOES NOT WORK - NO SEND
wclClient.Write(Buf, (uint) str.Length); // DOES NOT WORK - NO SEND
Can anyone offer a reasonable explanation as to why exactly I need to use wclShowError in this way? I need to place these functions into an architecture, and having some hidden code that could potentially open dialog boxes simply won't work. What can I do to correct the behavior, or what have I missed???
--Scott