到底该怎样???求解……拜托了~~~~(>_<)~~~~
程序代码:
//全局变量声明 HINSTANCE hInst; HPEN hPen[7]; HBRUSH hBru[7]; int sPen[7] = {PS_SOLID,PS_DASH,PS_DASHDOT,PS_DASHDOTDOT,PS_NULL,PS_INSIDEFRAME}; int sBru[6] = {HS_VERTICAL,HS_HORIZONTAL,HS_CROSS,HS_DIAGCROSS,HS_FDIAGONAL,HS_BDIAGONAL}; //、、、、、初始化函数 //建立7中不同的画笔及画刷对象 BOOL InitInstance(HINSTANCE hTnstance,int nCmdShow) { HWND hWnd; HDC hdc; int i; hInst = hInstance; hWnd = CreateWindow("canvas","绘图窗口",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,0,CW_USEDEFAULT,0, NULL,hInstance,NULL); if (!hWnd) { return FALSE; } MoveWindow(hWnd,10,10650,350,ture); ShowWindow(hWnd,nCmdShow); UpdateWindow(hWnd); for(i=0;i<=6;i++) { hPen[i] = CreatePen(sPen[i],1,RGB(255,0,0)); if(i = 6) hBru[i] = CreateSolidBrush(RGB(0,225,0)); else hBru[i] = CreateHatchBrush(sBru[i],RGB(0,225,0)); } hdc = GetDC(hwnd); Mypaint(hdc); ReleaseDC(hWnd); return TRUE; } //////////自定义绘图函数、、、、、、、、、 //////////以各式画笔及画刷绘制线条与填充矩阵 void MyPaint(HDC hdc) { int i,x1,x2,y; //////以7种不同画笔绘制线条 for(i=0;i<=6;i++) { y = (i+i)* 30; SelectObject(hdc,hPen[i]); MoveToEx(hdc,30,y,NULL); LineTo(hdc,100,y); } x1 = 120; x2 = 180; /////以7种不同的画刷填充矩阵 for(i=0;i<=6;i++) { SelectObject(hdc,hBru[i]); Rectangle(hdc,x1,30,x2,y); x1+=70; x2+=70; } } ///////////消息处理函数 ///////////1.窗口重绘消息发生时调用M有Paint() ///////////2.窗口结束消息发生时删除GDI对象 LRESULT CALLBACK WndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM 1Param) { PAINTSTRUCT ps; HDC hdc; int i; switch(message) { case WM_PAINT: hdc = BeginPaint(hWnd,&ps); MyPaint(hdc); EndPaint(hWnd,&ps); break; case WM_DESTROY: for(i=0;i<=6;i++) { DeleteObject(hPen[i]); DeleteObject(hBru[i]); } PostQuitMessage(0); break; default: return DefWindowProc(hWnd,message,wParam,1Param); } return 0; }对于打的这段代码无法通过visual C++6.0编译器,在Win32 Application里建立工程还是直接做源文件运行都不行,两个提示也不一样,真不知道该怎样办了,老鸟们,help!help!