General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
C++Builder5 Input field
I want to create a form with an input-field.
In this field the user can enter an address
an a data byte. My question is how to read
the data from the input-field and send it
to my development kit(EZ-USB FX). Below you'll find
a part of my program:
void __fastcall TForm1::Button5Click(TObject *Sender)
{
BULK_TRANSFER_CONTROL bulkControl;
UCHAR outBuffer[64];
WORD outPacketSize;
UCHAR inBuffer[64];
WORD inPacketSize;
unsigned long nBytes = 0;
int i;
char read;
BOOL success;
char str[10];
bulkControl.pipeNum = 1;
outPacketSize = 64;
// Clear Buffer
for(i = 0; i < 63 ; i++)
{
outBuffer = 0;
}
outBuffer[0] = data; // This needs to be the inputdata
success = DeviceIoControl (handle,
IOCTL_EZUSB_BULK_WRITE,
&bulkControl,
sizeof(BULK_TRANSFER_CONTROL),
&outBuffer[0],
outPacketSize,
&nBytes,
NULL);
if(success == TRUE)
{
sprintf (str, "Write succeeded: 0x%02X nbytes: 0x%02X", outBuffer[20], nBytes);
Memo1->Lines->Add(str);
}
}
If it isn't clear what I want to do, please ask
kind regards,
Chris