SteveCRM
Mar 3rd, 2001, 04:03 PM
I keep getting pretty bad errors on this...like protection faults.
here is the code in my button:
int thenumber;
char * pc;
itoa(thenumber, pc, thenumber);
srand(time(NULL));
num1 = 1 + rand() % 3;
num2 = 1 + rand() % 3;
num3 = 1 + rand() % 3;
SendMessage(ghWnd_Slot1, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) itoa(num1, pc, 10));
SendMessage(ghWnd_Slot2, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) itoa(num2, pc, 10));
SendMessage(ghWnd_Slot3, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) itoa(num3, pc, 10));
here is the code in my button:
int thenumber;
char * pc;
itoa(thenumber, pc, thenumber);
srand(time(NULL));
num1 = 1 + rand() % 3;
num2 = 1 + rand() % 3;
num3 = 1 + rand() % 3;
SendMessage(ghWnd_Slot1, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) itoa(num1, pc, 10));
SendMessage(ghWnd_Slot2, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) itoa(num2, pc, 10));
SendMessage(ghWnd_Slot3, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) itoa(num3, pc, 10));