Click here to Skip to main content
16,010,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMultilingual resource strings Pin
Kannan Ramanathan26-Jan-04 22:30
Kannan Ramanathan26-Jan-04 22:30 
GeneralRe: Multilingual resource strings Pin
Alberto Giannetto27-Jan-04 4:46
Alberto Giannetto27-Jan-04 4:46 
QuestionHow to make a Wizard? Pin
Jay.Jay26-Jan-04 22:18
Jay.Jay26-Jan-04 22:18 
AnswerRe: How to make a Wizard? Pin
Stlan26-Jan-04 22:45
Stlan26-Jan-04 22:45 
AnswerRe: How to make a Wizard? Pin
Joe Woodbury27-Jan-04 5:32
professionalJoe Woodbury27-Jan-04 5:32 
GeneralDLL debugging Pin
JeyKey26-Jan-04 22:12
JeyKey26-Jan-04 22:12 
GeneralRe: DLL debugging Pin
Stlan26-Jan-04 23:01
Stlan26-Jan-04 23:01 
QuestionCould somebody please help??? Pin
Einly26-Jan-04 22:08
Einly26-Jan-04 22:08 
Dear all,

I am using Visual C MFC Dialog-based application to obtain USB data from a Cypress chip. DeviceIoControl(IOCTL_EZUSB_BULK_READ...)... I am doing this using multithreading method. However, I face a problem when I compile. This is part of my program:

UINT SendOpThread(LPVOID pParam)
{
int bResult;
CThreadInfo* pTh = (CThreadInfo*)pParam;

BULK_TRANSFER_CONTROL2 btc;
btc.pipeNum = 0;

DeviceHandle = CreateFile("\\\\.\\ezusb-0",
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
bResult = DeviceIoControl (DeviceHandle,
IOCTL_EZUSB_BULK_READ,
&btc,
sizeof (BULK_TRANSFER_CONTROL),
r_Buffer,
sizeof(r_Buffer),
&nBytes,
NULL);

CloseHandle(DeviceHandle);

Confused | :confused: wsprintf(str, "r_Buffer[%d]: %04X\n", i,r_Buffer[i]);

SendDlgItemMessage(IDC_OUTPUT6,
LB_ADDSTRING,
0,
(LPARAM)(LPCTSTR) str);
Confused | :confused:
return(bResult);
}

void CUSB1Dlg::OnBulkRead()
{
// TODO: Add your control notification handler code here
int Code=1;

stream1 = fopen("data.txt","a+") ;

myWinThread = AfxBeginThread(SendOpThread, &Code, THREAD_PRIORITY_HIGHEST,0,CREATE_SUSPENDED);

myWinThread->m_bAutoDelete=FALSE;
myWinThread->ResumeThread();
.
.
.
}

When I compile, I got this error:

'SendDlgItemMessageA' : Function does not take 4 parameters

I found from the Help:
SendDlgItemMessage consists of 3 types: which is CWnd, CWindow, & Windows User Interface. Which 1 should the thread belongs to?

I assumed that it belongs to WUI, and so it requires HWND hDlg, a handle of dialog box. Since I am using Dialog-based application where the dialog is already created, how should I put for the hdlg parameter?

I really wish that someone could help me...

Einly
AnswerRe: Could somebody please help??? Pin
Steve S26-Jan-04 22:34
Steve S26-Jan-04 22:34 
GeneralRe: Could somebody please help??? Pin
Einly27-Jan-04 19:06
Einly27-Jan-04 19:06 
GeneralRe: Could somebody please help??? Pin
Einly27-Jan-04 19:06
Einly27-Jan-04 19:06 
GeneralGDI+ : construct Image from an IStream Pin
sstoyan26-Jan-04 21:55
sstoyan26-Jan-04 21:55 
GeneralRe: GDI+ : construct Image from an IStream Pin
Jörgen Sigvardsson27-Jan-04 1:16
Jörgen Sigvardsson27-Jan-04 1:16 
GeneralRe: GDI+ : construct Image from an IStream Pin
sstoyan27-Jan-04 2:18
sstoyan27-Jan-04 2:18 
GeneralRe: GDI+ : construct Image from an IStream Pin
Jörgen Sigvardsson27-Jan-04 10:54
Jörgen Sigvardsson27-Jan-04 10:54 
Generalnope, doesnt work still Pin
sstoyan27-Jan-04 10:48
sstoyan27-Jan-04 10:48 
GeneralRe: nope, doesnt work still Pin
Jörgen Sigvardsson27-Jan-04 10:55
Jörgen Sigvardsson27-Jan-04 10:55 
GeneralRe: nope, doesnt work still Pin
sstoyan27-Jan-04 13:43
sstoyan27-Jan-04 13:43 
Questionmodeless dialogs - ownmessage queue ? Pin
rrrado26-Jan-04 21:44
rrrado26-Jan-04 21:44 
AnswerRe: modeless dialogs - ownmessage queue ? Pin
Diddy27-Jan-04 0:11
Diddy27-Jan-04 0:11 
GeneralRe: modeless dialogs - ownmessage queue ? Pin
rrrado27-Jan-04 0:47
rrrado27-Jan-04 0:47 
QuestionHow to get CurrentDir of an application running in Embedded Visual C? Pin
ntnhan26-Jan-04 21:31
ntnhan26-Jan-04 21:31 
AnswerRe: How to get CurrentDir of an application running in Embedded Visual C? Pin
Michael P Butler27-Jan-04 1:57
Michael P Butler27-Jan-04 1:57 
GeneralUtility for checking dependencies Pin
rajeev26-Jan-04 21:31
rajeev26-Jan-04 21:31 
Generalmemory leak debugger Pin
Gérald Mercet26-Jan-04 21:16
Gérald Mercet26-Jan-04 21:16 

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.