.net - How can I find out what is wrong with a SetupDiGetClassDev interface in C#? -
Has it been wrong with the device's information set? I am writing again my code again and I'm still stalking the same one.
deviceInfoSet = SetupDiGetClassDevs (reference tGuid, 0, IntPtr.Zero, (uint) SetupDiFlags.DIGCF_PRESENT); If (deviceInfoSet.ToInt32 () == INVALID_DEVICE_HANDLE) {int errCode = Marshal.GetLastWin32Error (); Error Message = New Win32Exception (Marshal.GetLastWin32Error ()). message; StatusLabel.Text + = "Invalid deviceinfoset returned:" + errCode + "= & gt;" + Error message + "."; ";}
There is no error in the above code, but when I use the code below:
result = true; while (Results ) {result = SetupDiEnumDeviceInterfaces (deviceInfoSet, IntPtr.Zero, referee tGuid, index, ref anInterface); if (! result) {int errCode = Marshal.GetLastWin32Error (); error message = new Win32Exception (Marshal.GetLastWin32Error ()). message ; statusLabel.Text + = "\ nSetDiEnumDeviceInterface error:", "." + errCode + "= & gt" + errorMessage +; break;} index ++;} try
And device information set list, use of error code 259 C to ( is no more data is available ). I think I'm at a loss as wrong what is.
< Div class = "text" itemprop = "text">
Are you sure you are using the correct GUID?
Check Out
Edit: Everything else Some books look perfect and do the right thing.
Edit2: Try SetupDiGetClassDevs in call with DIGCF_DEVICEINTERFACE, and see that it works for you. That is, both DIGCF_PRESENT and DIGCF_DEVICEINTERFACE.
Edit 3: For 64-bit Issue (@TES), check out
Comments
Post a Comment