Consider the following function: It is called every second by a winapi timer to update a edit control showing for how long a specific procedure is runing. When the user kills the procedure, the timer is killed too.
HH, MM, SS are ints declared at main.c and initialized as 0 before the function starts.
int createTime() {
char ActiveTime[10];
SS++;
if (SS==60) {
SS=0;
MM++;
}
if (MM==60) {
MM=0;
HH++;
}
sprintf(ActiveTime, "%dh:%dm:%ds", HH, MM, SS);
SendMessage(hwndActiveTime, WM_SETTEXT, 0, ActiveTime);
return 0;
}
No matter how i change this function i always get an error:
[Warning] passing arg 4 of `SendMessageA' makes integer from pointer without a cast
Can anyne give me some help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Consider the following function: It is called every second by a winapi timer to update a edit control showing for how long a specific procedure is runing. When the user kills the procedure, the timer is killed too.
HH, MM, SS are ints declared at main.c and initialized as 0 before the function starts.
int createTime() {
char ActiveTime[10];
SS++;
if (SS==60) {
SS=0;
MM++;
}
if (MM==60) {
MM=0;
HH++;
}
sprintf(ActiveTime, "%dh:%dm:%ds", HH, MM, SS);
SendMessage(hwndActiveTime, WM_SETTEXT, 0, ActiveTime);
return 0;
}
No matter how i change this function i always get an error:
[Warning] passing arg 4 of `SendMessageA' makes integer from pointer without a cast
Can anyne give me some help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Consider the following function: It is called every second by a winapi timer to update a edit control showing for how long a specific procedure is runing. When the user kills the procedure, the timer is killed too.
HH, MM, SS are ints declared at main.c and initialized as 0 before the function starts.
int createTime() {
char ActiveTime[10];
SS++;
if (SS==60) {
SS=0;
MM++;
}
if (MM==60) {
MM=0;
HH++;
}
sprintf(ActiveTime, "%dh:%dm:%ds", HH, MM, SS);
SendMessage(hwndActiveTime, WM_SETTEXT, 0, ActiveTime);
return 0;
}
No matter how i change this function i always get an error:
[Warning] passing arg 4 of `SendMessageA' makes integer from pointer without a cast
Can anyne give me some help?
Here is a C tutorial that was given here:
http://pweb.netcom.com/~tjensen/ptr/pointers.htm
j@ck_
Consider the following function: It is called every second by a winapi timer to update a edit control showing for how long a specific procedure is runing. When the user kills the procedure, the timer is killed too.
HH, MM, SS are ints declared at main.c and initialized as 0 before the function starts.
int createTime() {
char ActiveTime[10];
SS++;
if (SS==60) {
SS=0;
MM++;
}
if (MM==60) {
MM=0;
HH++;
}
sprintf(ActiveTime, "%dh:%dm:%ds", HH, MM, SS);
SendMessage(hwndActiveTime, WM_SETTEXT, 0, ActiveTime);
return 0;
}
No matter how i change this function i always get an error:
[Warning] passing arg 4 of `SendMessageA' makes integer from pointer without a cast
Can anyne give me some help?
Cast (LPARAM) before ActiveTime, lparam supposed to be kind of integer type. Otherwise it supposed to convert array to pointer.
tkorrovi
Thanks tikorrovi, that solved my problem.