初级会员 
  
	- 积分
 - 106
 
        - 金钱
 - 106 
 
       - 注册时间
 - 2014-2-27
 
      - 在线时间
 - 0 小时
 
 
 
 | 
 
5金钱 
#include "led.h" 
#include "delay.h" 
#include "key.h" 
#include "sys.h" 
#include "tft.h" 
#include "usart.h"	  
#include "gui.h"  
#include "math.h" 
#include "includes.h" 
 
static void cbBackgroundWin(WM_MESSAGE* pMsg) 
{ 
switch(pMsg->MsgId) 
{ 
case WM_PAINT:  GUI_Clear(); 
default:   WM_DefaultProc(pMsg); 
} 
} 
 
static void cbForegroundWin(WM_MESSAGE* pMsg) 
{  
switch(pMsg->MsgId) 
{ 
 case WM_PAINT: 
     GUI_SetBkColor(GUI_GREEN); 
 GUI_Clear(); 
 GUI_DispString("Foreground window"); 
 break; 
      default: 
     WM_DefaultProc(pMsg);		    
} 
} 
static void DemoRedraw(void) 
{ 
GUI_HWIN hWnd; 
while(1) 
{ 
hWnd=WM_CreateWindow(10,10,100,100,WM_CF_SHOW,cbForegroundWin,0); 
delay_us(1000); 
WM_DeleteWindow(hWnd); 
GUI_DispStringAt("Background of window has not been redraw",10,10); 
delay_us(1000); 
GUI_Clear; 
WM_SetCallback(WM_HBKWIN,cbBackgroundWin); 
hWnd=WM_CreateWindow(10,10,100,100,WM_CF_SHOW,cbForegroundWin,0); 
delay_us(1000); 
WM_DeleteWindow(hWnd); 
delay_us(1000); 
WM_SetCallBack(WM_HBKWIN,0); 
 
 
} 
} 
void main(void) 
{ 
    delay_init(); 
   NVIC_Configuration(); 
   uart_init(9600);  
   GUI_Init();  
   DemoRedraw();  
} 
 
 
编译后出现下面的错误! 
Build target 'Template' 
compiling main.c... 
main.c(227): error:  #20: identifier "WM_MESSAGE" is undefined 
main.c(229): error:  #132: expression must have pointer-to-struct-or-union type 
main.c(231): error:  #20: identifier "WM_PAINT" is undefined 
main.c(232): warning:  #223-D: function "WM_DefaultProc" declared implicitly 
main.c(236): error:  #20: identifier "WM_MESSAGE" is undefined 
main.c(238): error:  #132: expression must have pointer-to-struct-or-union type 
main.c(240): error:  #20: identifier "WM_PAINT" is undefined 
main.c(246): warning:  #223-D: function "WM_DefaultProc" declared implicitly 
main.c(254): warning:  #223-D: function "WM_CreateWindow" declared implicitly 
main.c(254): error:  #20: identifier "WM_CF_SHOW" is undefined 
main.c(256): warning:  #223-D: function "WM_DeleteWindow" declared implicitly 
main.c(259): warning:  #174-D: expression has no effect 
main.c(260): warning:  #223-D: function "WM_SetCallback" declared implicitly 
main.c(260): error:  #20: identifier "WM_HBKWIN" is undefined 
main.c(265): warning:  #223-D: function "WM_SetCallBack" declared implicitly 
main.c(270): warning:  #951-D: return type of function "main" must be "int" 
Target not created 
求高手帮帮忙额 ! 
	 
  |   
 
 
最佳答案
查看完整内容[请看2#楼] 
回复【2楼】正点原子:
---------------------------------额 谢谢原子哥 我找到错误了,guiconf.h里面的那个GUI_WINSUPPORT要设置成1才行,原子哥有没有与UCGUI控件相关的一些学习资料啊 或者连接也可以的哦!跪求! 
 
 
 
 
 
 
 |