Click here to Skip to main content
15,890,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getter and setter style class implementation in VC++ Pin
Member 78851053-Feb-12 22:19
Member 78851053-Feb-12 22:19 
AnswerRe: Getter and setter style class implementation in VC++ Pin
Albert Holguin4-Feb-12 8:08
professionalAlbert Holguin4-Feb-12 8:08 
QuestionMessage for CASynsocket::OnConnect Pin
ForNow3-Feb-12 10:55
ForNow3-Feb-12 10:55 
AnswerRe: Message for CASynsocket::OnConnect Pin
Albert Holguin3-Feb-12 11:20
professionalAlbert Holguin3-Feb-12 11:20 
QuestionUpdating the color of child Window Pin
cpp_prgmer3-Feb-12 9:39
cpp_prgmer3-Feb-12 9:39 
AnswerRe: Updating the color of child Window Pin
Albert Holguin3-Feb-12 10:41
professionalAlbert Holguin3-Feb-12 10:41 
AnswerRe: Updating the color of child Window Pin
«_Superman_»3-Feb-12 15:32
professional«_Superman_»3-Feb-12 15:32 
QuestionHow to use DeviceIoControl to access an external USB device from MFC Pin
StefanKittel3-Feb-12 5:37
StefanKittel3-Feb-12 5:37 
Hello,

from a MFC program I need to send data to an external USB Device.

System: Windows XP SP3, MS Visual Studio 2008, WinDDK (most current).

Because I don't have any valid documentation I used a sniffer showing me the used commands.
GET_DESCRIPTOR_FROM_DEVICE and BULD_OR_INTERRUPT_TRANSFER

Using CreateFile I can successfull connect to the device.

But I failed to use DeviceIoControl.

C++
HANDLE result = CreateFile(dev_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

USBSCAN_GET_DESCRIPTOR data1;
DWORD bytesReturned;
BOOL b = DeviceIoControl(handle, IOCTL_GET_USB_DESCRIPTOR, NULL, 0, &data1, sizeof(USBSCAN_GET_DESCRIPTOR), &bytesReturned, NULL);


Error C2065 "USBSCAN_GET_DESCRIPTOR"

After including "usbscan.h" I get C2065 on METHOD_BUFFERED and FILE_ANY_ACCESS and C3861 on CTL_CODE.

When including wdm.h I get about 107 errors in driverspecs.h and kernelspecs.h.

So please, can anybody help me to get this run.

Thanks

Stefan
AnswerRe: How to use DeviceIoControl to access an external USB device from MFC Pin
Erudite_Eric3-Feb-12 6:29
Erudite_Eric3-Feb-12 6:29 
GeneralRe: How to use DeviceIoControl to access an external USB device from MFC Pin
StefanKittel3-Feb-12 6:46
StefanKittel3-Feb-12 6:46 
GeneralRe: How to use DeviceIoControl to access an external USB device from MFC Pin
Erudite_Eric4-Feb-12 4:32
Erudite_Eric4-Feb-12 4:32 
GeneralRe: How to use DeviceIoControl to access an external USB device from MFC Pin
StefanKittel4-Feb-12 4:49
StefanKittel4-Feb-12 4:49 
GeneralRe: How to use DeviceIoControl to access an external USB device from MFC Pin
Erudite_Eric4-Feb-12 22:42
Erudite_Eric4-Feb-12 22:42 
GeneralRe: How to use DeviceIoControl to access an external USB device from MFC Pin
StefanKittel5-Feb-12 10:20
StefanKittel5-Feb-12 10:20 
SuggestionRe: How to use DeviceIoControl to access an external USB device from MFC Pin
David Crow5-Feb-12 17:02
David Crow5-Feb-12 17:02 
Question"InvalidateRect" leaves dirty on screen Pin
transoft3-Feb-12 3:59
transoft3-Feb-12 3:59 
AnswerRe: "InvalidateRect" leaves dirty on screen Pin
Richard MacCutchan3-Feb-12 4:02
mveRichard MacCutchan3-Feb-12 4:02 
GeneralRe: "InvalidateRect" leaves dirty on screen Pin
transoft3-Feb-12 4:11
transoft3-Feb-12 4:11 
GeneralRe: "InvalidateRect" leaves dirty on screen Pin
Richard MacCutchan3-Feb-12 4:39
mveRichard MacCutchan3-Feb-12 4:39 
AnswerRe: "InvalidateRect" leaves dirty on screen Pin
Albert Holguin3-Feb-12 5:11
professionalAlbert Holguin3-Feb-12 5:11 
GeneralRe: "InvalidateRect" leaves dirty on screen Pin
transoft3-Feb-12 6:02
transoft3-Feb-12 6:02 
GeneralRe: "InvalidateRect" leaves dirty on screen Pin
SledgeHammer013-Feb-12 14:14
SledgeHammer013-Feb-12 14:14 
GeneralRe: "InvalidateRect" leaves dirty on screen Pin
transoft4-Feb-12 4:34
transoft4-Feb-12 4:34 
GeneralRe: "InvalidateRect" leaves dirty on screen PinPopular
SledgeHammer014-Feb-12 7:49
SledgeHammer014-Feb-12 7:49 
GeneralRe: "InvalidateRect" leaves dirty on screen Pin
MikeTHennessy7-Feb-12 12:10
MikeTHennessy7-Feb-12 12:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.