Not searching device on every character input from our vendor and product text field.
Selecting a device in our tree now triggers a search for it.
6 /// Used only in Debug.Write statements.
9 internal sealed partial class Debugging
12 /// Get text that describes the result of an API call.
15 /// <param name="functionName"> the name of the API function. </param>
21 internal String ResultOfApiCall( String functionName )
23 var resultString = new String(Convert.ToChar( 0 ), 129 );
25 // Returns the result code for the last API call.
27 Int32 resultCode = System.Runtime.InteropServices.Marshal.GetLastWin32Error();
29 // Get the result message that corresponds to the code.
32 Int32 bytes = NativeMethods.FormatMessage(NativeMethods.FormatMessageFromSystem, ref temp, resultCode, 0, resultString, 128, 0);
34 // Subtract two characters from the message to strip the CR and LF.
38 resultString = resultString.Remove( bytes - 2, 2 );
40 // Create the String to return.
42 resultString = Environment.NewLine + functionName + Environment.NewLine + "Result = " + resultString + Environment.NewLine;