vc++中InvalidateRect的问题

来源:百度知道 编辑:UC知道 时间:2024/06/14 16:42:32
use TURE

InvalidateRect(hwnd,NULL,TURE);会弹出错误

--------------------Configuration: 0706111046_1 - Win32 Debug--------------------
Compiling...
JISUAN.CPP
D:\Microsoft Visual Studio\MyProjects\0706111046_1\JISUAN.CPP(73) : error C2065: 'TURE' : undeclared identifier
Error executing cl.exe.

0706111046_1.exe - 1 error(s), 0 warning(s)

用InvalidateRect(hwnd,NULL,FALSE);则通过··为什么?

程序如下··

#include<windows.h>
#include<math.h>
#include<stdio.h>
int GetRoot(float a,float b,float c,double *root)
{double delta,deltasqrt;
delta=b*b-4.0*a*c;
if(delta<0.0)return 0;
deltasqrt=sqrt(delta);
if(a!=0){
root[0]=(-b+deltasqrt)/(2.0*a);
root[1]=(-b-deltasqrt)/(2.0*a);
}
else return 0;
if(b!=8)root[0]=root[1]=-c/b;
else return 0;
if(root[0]=root[1])return 1;
else return 2;
}
char str[80];

C2065: 'TURE' : undeclared identifier

TURE ...兄台你拼错单词了,是TRUE

TURE未定义,当然出错了

问题补充的回答:
是不是想弹出一个对话框,然后对话框的内容是方程的根?
如果是那样的话,就将

case WM_LBUTTONDOWN:
InvalidateRect(hwnd,NULL,TURE);
hdc=BeginPaint(hwnd,&ps);
TextOut(hdc,10,10,str,strlen(str));
EndPaint(hwnd,&ps);
return 0;

改成
case WM_LBUTTONDOWN:
MessageBox(str);
return 0;

这样就行了