TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
gongdehui
NA
63
0
Why SetupDiEnumDeviceInterfaces() always returns false?
Nov 2 2004 8:22 AM
//my c# code: public class Win32 {...... public static Guid GUID_DEVINTERFACE_USB_DEVICE = new Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED"); public class SP_DEVICE_INTERFACE_DATA { public int cbSize; public Guid InterfaceClassGuid; public int Flags; public ulong Reserved; } ...... } public class usbdevice { IntPtr hDevInfo; Win32.SP_DEVICE_INTERFACE_DATA DeviceInterfaceData = new Win32.SP_DEVICE_INTERFACE_DATA(); ...... hDevInfo = Win32.SetupDiGetClassDevs(ref Win32.GUID_DEVINTERFACE_USB_DEVICE, null, // Enumerator null, Win32.DIGCF_PRESENT | Win32.DIGCF_DEVICEINTERFACE); //flags ...... DeviceInterfaceData.cbSize = (int)Marshal.SizeOf(new Win32.SP_DEVICE_INTERFACE_DATA().GetType()); bResult = SetupDiEnumDeviceInterfaces(hDevInfo, null, ref Win32.GUID_DEVINTERFACE_USB_DEVICE, memberIndex, DeviceInterfaceData); ...... } //after invoked the Win32.SetupDiGetClassDevs(),the hDevInfo is not -1. But the bResult always returns false,what's the problem? Thanks!
Reply
Answers (
1
)
Error :Unable to load DLL (Setupapi.lib)
string bla = @"