i'm trying to get this struct into my thread, however i'm getting trash in it.
struct i'm using:
typedef struct {
HWND hWnd;
int cntrlid;
TCHAR text[BUFF];
}parametros;
in the message switch i have the case to control a button witch starts the thread:
case IDC_TAB_A:
threaddata.hWnd=hWnd;
threaddata.cntrlid=IDC_TAB_A;
_tcscpy(threaddata.text, _T("Carregou A"));
hThreadsender=CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadSenderProc, (LPVOID) &threaddata, 0, NULL);
break;
and the function to handle the thread i got:
DWORD WINAPI ThreadSenderProc(LPVOID param){
parametros temp=*((parametros *)param);
EnviaLetra(temp.hWnd, temp.text,temp.cntrlid);
return 0;
}
something must be wrong, but i cant get what it is, can anyone help?
Thanks in advance! (sorry bad english!)