d2.doc

Size: px
Start display at page:

Download "d2.doc"

Transcription

1 2 Windows Windows Windows Windows Windows Windows Windows Windows Windows Windows DOS Windows Windows Windows 1.0 Microsoft

2 2 Windows Windows 1.0 DOS Windows Microsoft Windows 2.0 Windows Windows 2.0 IBM PM Windows 2.0 OS/2 Windows 2.0 DOS DOS 1990 Windows 3.0 Mac OS Mac PC DOS PC Mac Apple 5 Windows 3.0 Windows 2.0 Microsoft Windows 3.1 Windows 4.0 Microsoft Windows 3.1 Windows 3.1 Windows 3.11 Windows 3.1 DOS DOS DOS Windows Windows Windows 95 PC Windows NT 3.0 NT 41

3 Windows 95 Windows Windows Windows 95 Windows 95 Windows 3.1 Windows 95 Intel PC DOS DOS 1996 Microsoft Game SDK DirectX Windows 95 DOS DOOM Duke Nukem DOS32 DirectX PC 3.0 DirectX DOS DirectX DirectX COMDirectX Win32/DirectX PC 1998 Windows 98 Windows 95 Windows DirectX 3D Internet Windows 98 Windows 95 Windows98 Windows 95 42

4 2 Windows Windows NT Windows 5.0 Windows 9X NT Windows 9X NT Windows 9X Windows NT 5.0 Win32/DirectX Windows 9X Windows NT 5.0 PC DirectX Win32 Windows NT 5.0 NT DirectX DEC Alphas Windows CE DirectX Win32 DOS Windows Windows Windows NT Windows Win9X/NT Windows Windows 2.1 CPU Win9X/NT CPU OS 43

5 Windows Windows 30~50 Windows Intel CPU n Windows Windows Ctrl+Alt+Delete 44

6 X 第 2 章 Windows 编程模型 X 许多共享软件和商用软件工具都能做到这一点 但是 Windows 内嵌了这几个工具 在安装 Windows 的目录 一般是 Windows\ 下 可以发现一个名字为 SYSMON.EXE Windows 95/98 或 PREFMON.EXE Windows NT 的可执行程序 图 2.3 描述了在我的 Windows 98 机器上运行的 SYSMON.EXE 程序 图中除了正在运行的线程外还有大量的信 息 如 内存使用和处理器装载等 实际上在进行程序开发时 我喜欢使 SYSMON.EXE 运 行 由此可以了解正在进行什么以及系统如何加载程序 图 2.3 运行的 SYSMON.EXE 你可能想知道能否对线程的创建进行控制 答案是能够 实际上这是 Windows 游戏 编程最令人激动的事情之一 就像我们所希望的那样除了游戏主进程外 还能够执行其他 的任务 我们也能够创建像其他任务一样多的线程 注 意 在 Windows 98/NT 环境下 实际上还有一种叫 fiber 的新型执行对象 它比线程还 简单 明白吗 线程是由 fiber 构成的 这和 DOS 游戏程序的编写有很大不同 DOS 是单线程操作系统 也就是说一旦你的程 序开始运行 就只能运行该程序 不时出现的中断管理除外 因此 如果想使用任何一种 多任务或多线程 就必须自己来模拟 参阅 Sams Teach Yourself Game Programming in 21 Days 中关于一个完整的基于 DOS 的多任务核心部分 这也正是游戏程序员在这么多年中 所作的事 的确 模拟多任务和多线程远远不能和拥有一个完整的支持多任务和多线程的操 作系统相提并论 但是对于单个游戏来讲 它足可以良好地工作 在我们接触到真正的 Windows 编程和那些工作代码之前 我想提及一个细节 你可能 在想 Windows 真是一个神奇的操作系统 因为它允许多个任务和程序立即执行 请记住 实际上并不是这样的 如果只有一个处理器的话 那么一次也只能执行一个执行流 线程 程序或你所调用的任何对象 Windows 相互之间的切换太快了 以至于看上去就像几个程序 45

7 CPU Pentium II 400MHz Pentium II Windows NT 5.0 fiber Pentium U V Pentium II 5 Windows / DOS Windows Windows 2.4 Windows Windows Windows Windows Windows 3.0/3.1 Windows Windows 46

8 2 Windows Windows 9X/NT Windows Windows Microsoft Microsoft Microsoft Charles Simonyi Microsoft Microsoft API Microsoft 2.1 c by n i 2.1 x, y x y 47

9 cx, cy b w l dw fn s sz, str lp h msg x y c UINT WORD LONG DWORD 0 32 Windows 2.1 char *szfilename; int *lpidate; BOOL bsemaphore; WORD dwmaxcount; // a nulla terminated string // a 32-bit pointer to an int // a boolean value // a 32-bit unsigned WORD int g_ixpos; // a global x-position int g_itimer; // a global y-position char *g_szstring; // a global NULL terminated string g_ g 48 int PlotPixel(int ix, int iy, int ic); void *MemScan(char *szstring);

10 2 Windows int Get_Pixel(int ix, int iy); const LONG NUM_SECTORS = 100 // a C++ style constant #define MAX_CELLS 64; // a C style constant #define POWERUNIT 100; // a C style constant typedef unsigned char UCHAR; // a user defined type Microsoft C++ C++ const #define Const #define C++ C class CVector public CVector (); ix=iy=iz=imagnitude = 0;} CVector(int x, int y, int z) ix=x; iy=y; iz=z;}.. private: int ix, iy, iz; // the position of the vector int imagnitude; // the magnitude of the vector } 49

11 UCHAR GetPixel(int x, int y); UCHAR GetPixel(int ix, int iy); UCHAR GetPixel(int, int); 20 Win32 API Windows Windows Windows Windows 2.1 DOS 2.1 DOS // DEMO2_1.CPP - standard version #include <stdio.h> // main entry point for all standard DOS/console programs void main(void) printf( \nthere CAN BE ONLY ONE!!!\n ); } // end main Windows 50

12 2 Windows DEMO2_1.CPP VC++ Borland DOS 32 Windows WinMain() DOS Main() WinMain() Win32 API Win32 API MessageBox() 2.2 Windows 2.2 Windows // DEMO2_2.CPP - a simple message box #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> // the main windows headers // a lot of cool macros // main entry point for all windows programs int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) // call message box api with NULL for parent window handle MessageBox(NULL, THERE CAN BE ONLY ONE!!!, MY FIRST WINDOWS PROGRAM, MB_OK MB_ICONEXCLAMATION); // exit program return(0); } // end WinMain 1 Win32.EXE CD-ROM T3DCHAP02\ DEMO2_2.CPP 2 51

13 3 CD-ROM DEMO2_2.EXE Windows DEMO2_2.EXE Windows #define Win32_LEAN_AND_MEAN Windows Microsoft Microsoft Foundation Classes,MFC Software Development Kit,SDKMFC C++ 10 SDK C SDK Win32_LEAN_AND_MEAN MFC #include windows.h #include windowsx.h windows.h Windows Windows windowsx.h Windows Windows WinMain() int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow); 52

14 2 Windows WINAPI PASCAL CDECL PASCAL WINAPI WinMain() WINAPI hinstance Windows hinstance hprevinstance Windows Microsoft lpcmdline C/C++ main( int argc, char **argv) argc TEST.EXE Windows TEST.EXE one lpcmdline lpcmdline = one two three.exe ncmdshow ShowWindow() 2.2 ncmdshow 2.2 ncmdshow Windows SW_SHOWNORMAL SW_SHOW SW_HIDE Windows 53

15 SW_MAXIMIZE SW_MINIMIZE SW_RESTORE SW_SHOWMAXIMIZED SW_SHOWMINIMIZED SW_SHOWMINNOACTIVE SW_SHOWNA SW_SHOWNOACTIVATE Windows 2.2 ncmdshow ncmdshow ShowWindow() Windows VCR Windows 99% SW_SHOW SW_SHOWNORMAL SW_HIDE 1% WinMain() MessageBox() MessageBox() Win32 API Windows MessageBox() MessageBox() int MessageBox( HWND hwnd, // handle of owner window LPCTSTR lptext, // address of text in message box LPCTSTR lpcaption, // address of title of message box UINT utype); // style of message box 54 hwnd DEMO2_2.CPP NULL Windows

16 2 Windows lptext lpcaption utype 2.3 MessageBox() 2.3 MessageBox() MB_OK MB_OKCANCEL MB_RETRYCANCEL MB_YESNO MB_YESNOCANCEL MB_ABORTRETRYIGNORE OK OK Cancel Retry Cancel Yes No Yes No Cancel Yes No Cancel MB_ICONEXCLAMATION MB_ICONINFORMATION MB_ICONQUESTION MB_ICONSTOP I MB_DEFBUTTONn n 1~4 OS Win32 SDK 2.3 Win32 API MessageBox() yes/no MessageBox() 55

17 IDABORT IDCANCEL IDIGNORE IDNO IDOK IDRETRY IDYES Abort Cancel Ignore No OK Retry Yes Windows MessageBeep() Win32 SDK MessageBox() BOOL MessageBeep(UINT utype); // MessageBeep() MB_ICONASTERISK MB_ICONEXCLAMATION MB_ICONHAND MB_ICONQUESTION MB_OK 0xFFFFFFFF 56 MS-Plus Win32 API I/O GUI Windows Windows / Windows Windows WinMain() WinMain() DOS Main() Windows

18 2 Windows Windows Windows 3D Windows Windows Windows 32 DOS Windows Windows 1. Windows 2. WinProc 3. Windows Windows 4. Windows 5. Windows Windows Windows Windows C++ Windows Windows Windows Windows Windows Windows Windows Windows Windows Windows WNDCLASS WNDCLASSEX WNDCLASS WNDCLASSEX Win32 WNDCLASS Windows WNDCLASSEX typedef struct _WNDCLASSEX UINT cbsize; // size of this structure UINT style; // style flags 57

19 WNDPROC lpfnwndproc; // function pointer to handler int cbclsextra; // extra class info int cbwndextra; // extra instance info HANDLE hinstance; // the instance of the application HICON hicon; // the main icon HCURSOR hcursor; // the cursor for the window HBRUSH hbrbackground; // the background brush to paint the window LPCTSTR lpszmenuname; // the name of the menu to attach LPCTSTR lpszclassname; // the name of the class itself HICON hiconsm; // the handle of the small icon } WNDCLASSEX WNDCLASSEX winclass; // a blank windows class cbsize Petzold Programing Windows 95 WNDCLASSEX winclass.cbsize = sizeof(wndclassex); Windows CS_HREDRAW CS_VREDRAW CS_OWNDC CS_DBLCLKS CS_PARENTDC CS_SAVEBITS CS_NOCLOSE

20 2 Windows Windows Windows CS_OMNDC Windows winclass.style = CS_VERDRAW CS_HREDRAW CS_OWNDC CS_DBLCLICKS; WNDCLASSEX lpfnwndproc Windows Windows Windows Windows Windows 2.6 winclass.lpfnwndproc = WinProc; // 2.6 Windows C++ int Add(int op1,int op2) return(op1+op2);} int Sub(int op1,int op2) return(op1-op2);} 59

21 C++ // define a function pointer that takes two int and returns an int int (Math*)(int, int); Math = Add; int result = Math(1,2);// this reslly calls Add(1,2) // result will be 3 Math = Sub; Int result = Math(1,2);// this really calls Sub(1,2) // result will be 1 cbclsextra cbwndextra Windows Windows 0 winclass.cbclsextra = 0; // extra class info space winclass.cbwndextra = 0; // extra window info space hinstance WinMain() WinMain() winclass.hinstance = hinstance; // assign the application instance Windows Windows Windows Microsoft Microsoft [ ] h LoadIcon() winclass.hicon = LoadIcon(NULL, IDI_APPLICATION); IoadIcon() 2.7 HICON LoadIcon(HINSTANCE hinstance, // handle of application instance LPCTSTR lpiconname); // icon-name string or icon resource identifier 60

22 2 Windows hinstance NULL LpIconName NULL hinstance NULL lpiconname LoadIcon() IDI_APPLICATION IDI_ASTERISK IDI_EXCLAMATION IDI_HAND IDI_QUESTION IDI_WINLOGO Windows hcursor hicon hcursor LoadCursor() Windows winclass.hcursor = LoadCursor(NULL, IDC_ARROW); LoadCursor() 2.8 HCURSOR lpcursor( HINSTANCE hinstance, // handle of application instance LPCTSTR lpcursorname); // icon_name string or icon resource identifier hinstance.exe.exe NULL lpcursorname LoadCursor() IDC_ARROW IDC_APPSTARTING IDC_CROSS IDC_IBEAM IDC_NO I 61

23 IDC_SIZEALL IDC_SIZENESW IDC_SIZENS IDC_SIZENWSE IDC_SIZEWE IDC_UPARROW IDC_WAIT hbrbackground Windows Windows hbrbackground GDI GetStockObject() winclass.hbrbackground = GetStockObject(WHITE_BRUSH) GetStockObject() Windows GetStockObject() GetStockObject() BLACK_BRUSH WHITE_BRUSH GRAY_BRUSH LTGRAY_BRUSH DKGRAY_BRUSH HOLLOW_BRUSH NULL_BRUSH BLACK_PEN WHITE_PEN NULL_PEN NULL NULL WNDCLASS lpszmenuname ASCII 62

24 2 Windows Windows NULL Winclass.lpszmenuName=NULL //the name of the menu to attach Windows Windows lpszclassname WINCLASS1 WINCLASS2 Winclass.lpszClassName = WINCLASS1 ; // the name of the class itself Windows Windows WNDCLASSEX WNDCLASS Windows LoadIcon() Windows winclass.hiconsm = LoadIcon(NULL, IDI_APPLICATION) // WNDCLASSEX winclass; // this will hole the class we create // first fill in the window class structure winclass.cbsize = sizeof(wndclassex); winclass.style = CS_DBLCLKS CS_OWNDC CS_HREDRAW CS_VREDRAW; winclass.lpfnwndproc = WindowProc; winclass.cbclsextra = 0; winclass.cbwndextra = 0; winclass.hinstance = hinstance; winclass.hicon = LoadIcon(NULL,IDI_APPLICATION); winclass.hcursor = LoadCursor(NULL, IDC_ARROW); winclass.hbrbacground = GetStockObject(BLACK_BRUSH); winclass.lpszmenuname = NULL; winclass.lpszclassname = WINCLASS ; winclass.hiconsm = LoadIcon(NULL, IDI_APPLICATION); WNDCLASSEX winclass = winclass.cbsize = sizeof(wndclassex), CS_DBLCLKS CS_OWNDC CS_HREDRAW CS_VREDRAW, WindowProc, 0, 63

25 0, hinstance, LoadIcon(NULL,IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW), GetStockObject(BLACK_BRUSH), NULL, WINCLASS1, LoadIcon(NULL, IDI_APPLICATION)}; Windows Windows winclass Windows RegisterClassEx() RegisterClassEx( &winclass ); WINCLASS1 RegisterClassEx() RegisterClassEx() Windows RegisterClass() WNDCLASS Windows 64 CreateWindow() CreateWindowEx() Windows Windows WINCLASS1 Windows CreateWindowEx() HWND CreateWindowEx( DWORD dwexstyle, // extended window style LPCTSTR lpclassname, // pointer to registered class name

26 2 Windows LPCTSTR lpwindowname, // pointer to window name DWORD dwstyle, // window style int x, // horizontal position of window int y, // vertical position of window int nwidth, // window width int nheight, // window height HWND hwndparent, // handle to parent or owner window HMENU hmenu, // handle to menu,or child window identifier HINSTANCE hinstance, // handle to application instance LPVOID lpparam); // pointer to window-creation data NULL dwexstyle NULL Win32 SDK WS_EX_TOPMOST lpclassname WINCLASS1 lpwindowname dwstyle 2.10 x y CW_USEDEFAULT Windows nwidth nheight CW_USEDEFAULT Windows hwndparent hmenu NULL hinstance WinMain() lpparam NULL dwstyle WS_POPUP WS_OVERLAPPED WS_TILED 65

27 WS_OVERLAPPEDWINDOW WS_VISIBLE WS_SYSMENU WS_BORDER WS_CAPTION WS_ICONIC WS_MAXIMIZE WS_MAXIMIZEBOX WS_MINIMIZE WS_MINIMIZEBO X WS_POPUPWINDOW WS_SIZEBOX WS_HSCROLL WS_VSCROLL WS_OVERLAPPED WS_CAPTION WS_SYSMENU WS_THICKFRAME WS_MAXIMIZEBOX WS_MINIMIZEBOX WS_BORDER WS_MINIMIZE WS_EX_ CONGTEXTHELP WS_SYSMENU WS_ICONIC WS_EX_ CONGTEXTHELP WS_SYSMENU WS_BORDER WS_POPUP WS_SYSMENU WS_THICKFRAME 0,0 400X400 HWND hwnd; // window handle // create the window,bail if problem if (!(hwnd = CreateWindowEx(NULL, // extended style WINCLASS ; // class Your Basic Window, // title WS_OVERLAPPEDWINDOW WS_VISIBLE; 0,0 // initial x,y 400,400 // initial width,height NULL // handle to parent NULL // handle to menu hinstance, // instance of this application NULL))) // extra creation parms return( 0 ); 66

28 2 Windows WS_VISIBLE // this shows the window ShowWindow(hwnd, ncmdshow); WinMain() ncmdshow WS_VISIBLE ncmdshow ShowWindow() Windows WM_PAINT UpdateWindow() // this sends a WM_PAINT message to window and makes // sure the contents are refreshed UpdateWindow(); Windows Windows 2.6 Windows Windows Windows Procedure WinProc Windows WinProc Windows / WinProc Windows WinProc WinProc WinProc WinProc WinProc WinProc 67

29 LRESULT CALLBACK WindowProc( HWND hwnd, // window handle of sender UINT msg, // the message id WPARAM wparam, // further defines message LPARAM lparam); // further defines message winclass.lpfnwndproc winclass.lpfnwndproc = WindowProc; hwnd Windows Windows hwnd msg WinProc Winclass1 WinProc() Windows Wparam lparam msg LRESULT CALLBAK switch() msg msg wparam / lparam WinProc WinProc

30 2 Windows WM_ACTIVATE WM_CLOSE WM_CREATE WM_DESTROY WM_MOVE WM_MOUSEMOVE WM_KEYUP WM_KEYDOWN WM_TIMER WM_USER WM_PAINT WM_QUIT WM_SIZE Windows 2.11 WinProc msg wparam lparam Win32 SDK WM_CREATE WM_PAINT WM_DESTROY WM_QUIT Windows OK WinProc LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); // this is the main message handler of the system PAINTSTRUCT ps; // Used in WM_PAINT HDC hdc; // handle to a device context 69

31 // what is the message switch(msg) case WM_CREATE; // do initialization stuff here // return success return ( 0 ) } break; case WM_PAINT; // simply validate the window hdc = BeginPaint(hwnd, &ps); // you woudle do all your painting here EndPaint(hwnd, &ps); // return success return ( 0 ) } break; case WM_DESTROY; // Kill the application,this sends a WM_QUIT message PostQuitMessage ( 0 ); // return success return ( 0 ) } break; default:break; } // end switch // process any message that we didn't take care of return (DefWindowProc(hwnd, msg, wparam, lparam)); } // end WinProc 70 WM_CREATE return(0) Windows WM_CREATE WM_PAINT DirectX / Windows

32 2 Windows WM_PAINT Windows WM_PAINT BeginPaint() EndPaint() Windows hbrbackground // begin painting hdc = BeginPaint(hwnd, &ps); // you would do all your painting here EndPaint(hwnd, &ps); hwnd BeginPaint EndPaint PAINTSTRUCT PAINTSTRUCT typedef struct tagpaintstruct HDC hdc; BOOL ferase; RECT rcpaint; BOOL frestore; BOOL fincupdate; BYTE rgbreserved[32]; } PAINTSTRUCT; rcpaint 2.8 Windows Windows typedef struct tagrect LONG left; // left x-edge of rect LONG top; // top y-edge of rect LONG right; // right x-edge of rect LONG bottom; // bottom y-edge of rect } RECT; BeginPaint(), hdc HDC hdc; // handle to graphics context Hdc = BeginPaint(hwnd, &ps) 71

33 WM_PAINT 2.8 WM_PAINT WM_DESTROY WM_DESTROY WM_QUIT PostQuitMessage() Wm_DESTROY PostQuitMessage(0) Windows WM_QUIT WinProc return(0) WinProc Windows DefaultWindowProc() Windows // process any messages that we didn t take care of return (DefWindowProc(hwnd, msg, wparam, lparam)); Windows DOS32 72

34 Windows 2 Windows // enter main event loop while(getmessage(&msg, NULL, 0, 0)) // translate any accelerator keys TranslateMessage(&msg); // send the message to the window proc DispatchMessage(&msg); } // end while OK GetMessage() while() GetMessage() GetMessage() NULL 0 BOOL GetMessage( LPMSG lpmsg, // address of structure with message HWND hwnd, // handle of window UINT wmsgfiltermin, // first message UINT wmsgfiltermax); // last message msg Windows WinProc() msg msg WinProc MSG typedef struct tagmsg HWND hwnd; UINT message; WPARAM wparam; LPARAM lparam; DWORD time; POINT pt; } MSG; // window where message occurred // message id itself // sub qualifies message // sub qualifies message // time if message event // position of mouse WinProc() GetMessage() 73

35 TranslateMessage() TranslateMessage() DispatchMessage() GetMessage() TranslateMessage() DispatchMessage() WinProc DispatchMessage() WinProc MSG Windows 90% 2.3 Windows 2.3 Windows 74 // DEMO2_3.CPP - A complete windows program // INCLUDES /////////////////////////////////////////////// #define WIN32_LEAN_AND_MEAN // just say no to MFC #include <windows.h> // include all the windows headers #include <windowsx.h> // include useful macros #include <stdio.h> #include <math.h> // DEFINES //////////////////////////////////////////////// // defines for windows

36 2 Windows #define WINDOW_CLASS_NAME WINCLASS1 // GLOBALS //////////////////////////////////////////////// // FUNCTIONS ////////////////////////////////////////////// LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) // this is the main message handler of the system PAINTSTRUCT ps; // used in WM_PAINT HDC hdc; // handle to a device context // what is the message switch(msg) case WM_CREATE: // do initialization stuff here // return success return(0); } break; case WM_PAINT: // simply validate the window hdc = BeginPaint(hwnd,&ps); // you would do all your painting here EndPaint(hwnd,&ps); // return success return(0); } break; case WM_DESTROY: // kill the application, this sends a WM_QUIT message PostQuitMessage(0); // return success return(0); } break; default:break; } // end switch 75

37 // process any messages that we didn t take care of return (DefWindowProc(hwnd, msg, wparam, lparam)); } // end WinProc // WINMAIN //////////////////////////////////////////////// int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) WNDCLASSEX winclass; // this will hold the class we create HWND hwnd; // generic window handle MSG msg; // generic message // first fill in the window class structure winclass.cbsize = sizeof(wndclassex); winclass.style = CS_DBLCLKS CS_OWNDC CS_HREDRAW CS_VREDRAW; winclass.lpfnwndproc = WindowProc; winclass.cbclsextra = 0; winclass.cbwndextra = 0; winclass.hinstance = hinstance; winclass.hicon = LoadIcon(NULL, IDI_APPLICATION); winclass.hcursor = LoadCursor(NULL, IDC_ARROW); winclass.hbrbackground = GetStockObject(BLACK_BRUSH); winclass.lpszmenuname = NULL; winclass.lpszclassname = WINDOW_CLASS_NAME; winclass.hiconsm = LoadIcon(NULL, IDI_APPLICATION); // register the window class if (!RegisterClassEx(&winclass)) return(0); // create the window if (!(hwnd = CreateWindowEx(NULL, // extended style WINDOW_CLASS_NAME, // class Your Basic Window, // title WS_OVERLAPPEDWINDOW WS_VISIBLE, 0,0, // initial x,y 400,400, // initial width, height NULL, // handle to parent NULL, // handle to menu hinstance,// instance of this application NULL))) // extra creation parms return(0); 76

38 2 Windows // enter main event loop while(getmessage(&msg,null,0,0)) // translate any accelerator keys TranslateMessage(&msg); // send the message to the window proc DispatchMessage(&msg); } // end while // return to Windows like this return(msg.wparam); } // end WinMain /////////////////////////////////////////////////////////// DEMO2_3.CPP Win32.EXE DEMO2_3.CPP CD-ROM DEMO2_3.EXE DEMO2_3.EXE GetMessage() Windows 77

39 PeekMessage() GetMessage() 78 BOOL PeekMessage( LPMSG lpmsg, // pointer to structure for message HWND hwnd, // handle to window UINT wmsgfiltermin, // first message UINT wmsgfiltermax, // last message UINT wremovemsg) // removal flags wremovemsg PM_NOREMOVE PeekMessage() PM_REMOVE PeekMessage() PeekMessage() PM_NOREMOVE GetMessage() PM_REMOVE PeekMessage() while(true) // test if there is a message in queue,if so get it if (PeekMessage(&msg, NULL,0,0,PM_REMOVE) // test if this a quit if (msg.message = = WM_QUIT) break; // translate any accelerator keys TranslateMessage( &msg ); // send the message to the window proc DispatchMessage( &msg ); } // end if // main game processing goes here Game_Main(); } // end while if (msg.message = = WM_QUIT) break; while(true) WinProc WM_DESTROY PostQuitMessage() WM_QUIT WM_QUIT

40 2 Windows Game_Main() Windows DEMO2_4.CPP CD-ROM DEMO2_4.EXE CreateWindowEx() Windows WinProc WinProc WINCLASSEX lpfnwndproc 2.11 Windows 2.11 Windows WinProc Windows WinProc

41 1 2 Windows WinProc() 2.12 Windows // create the first window if (!(hwnd = CreateWindowEx(NULL, // extended style WINDOW_CLASS_NAME, // class Window 1 Based on WINCLASS1, // title WS_OVERLAPPEDWINDOW WS_VISIBLE, 0,0, // initial x,y 400,400 // initial width,height NULL, // handle to parent NULL, // handle to menu hinstance, // instance of this application NULL // extra creation parms return (0); // create the second window if (!(hwnd = CreateWindowEx(NULL, // extended style WINDOW_CLASS_NAME, // class Window 2 Also Based on WINCLASS1, // title WS_OVERLAPPEDWINDOW WS_VISIBLE, 100,100, // initial x,y 400,400 // initial width,height NULL, // handle to parent NULL, // handle to menu hinstance, // instance of this application NULL // extra creation parms return (0); hwnd DEMO2_5.CPP CD-ROM DEMO2_5.EXE 80

42 2 Windows 2.13 Windows WM_QUIT 2.13 DEMO2_5.EXE Windows Windows Windows Windows Windows Windows 81

Microsoft PowerPoint - gp2.ppt

Microsoft PowerPoint - gp2.ppt Windows 視窗程式設計 (1) 靜宜大學資訊管理學系蔡奇偉副教授 大綱 Windows 視窗系統的特性 Windows API MSDN 線上說明文件 匈牙利 (Hungarian) 命名法 一個最少行的 Windows 視窗程式 Windows 程式的事件處理模型 視窗程式的骨架 1 Windows 視窗系統的特性 圖形化的人機介面 圖形顯示器 視窗 滑鼠 + 鍵盤 Multiprocessing

More information

Microsoft PowerPoint - gp3.ppt

Microsoft PowerPoint - gp3.ppt Windows 視窗程式設計 (2) 靜宜大學資訊管理學系蔡奇偉副教授 大綱 視窗的結構 Painting and Repainting GDI Device Context 視窗版的 Hello, world! 程式 取得裝置的功能資訊 版權所有 : 靜宜大學資訊管理學系蔡奇偉副教授 1 視窗的結構 標題列 (title) 工具列 (tools) 功能表 (menu) 工作區 (client) 狀態列

More information

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2 PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

Microsoft Word - CIN-DLL.doc

Microsoft Word - CIN-DLL.doc 6.3. 调 用 动 态 链 接 库 (DLL) 相 对 于 CIN 来 讲,NI 更 推 荐 用 户 使 用 DLL 来 共 享 基 于 文 本 编 程 语 言 开 发 的 代 码 除 了 共 享 或 重 复 利 用 代 码, 开 发 人 员 还 能 利 用 DLL 封 装 软 件 的 功 能 模 块, 以 便 这 些 模 块 能 被 不 同 开 发 工 具 利 用 在 LabVIEW 中 使 用

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

C/C++程序设计 - 字符串与格式化输入/输出

C/C++程序设计 - 字符串与格式化输入/输出 C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int

More information

Microsoft PowerPoint - directx01.ppt

Microsoft PowerPoint - directx01.ppt 電腦遊戲程式設計 DirectX 簡介 靜宜大學資訊管理學系蔡奇偉副教授 大綱 何謂 DirectX? DirecX 的模組 HAL 和 HEL COM 檢查安裝的 DirectX 版本 遊戲程式的骨架 DirectX 繪圖程式的骨架 版權所有 : 靜宜大學資管系蔡奇偉副教授 1 何謂 DirectX? Windows API 的架構無法滿足電腦遊戲與多媒體軟體的即時性需求, 因而微軟公司規劃出 DirectX

More information

Windows XP

Windows XP Windows XP What is Windows XP Windows is an Operating System An Operating System is the program that controls the hardware of your computer, and gives you an interface that allows you and other programs

More information

ebook50-15

ebook50-15 15 82 C / C + + Developer Studio M F C C C + + 83 C / C + + M F C D L L D L L 84 M F C MFC DLL M F C 85 MFC DLL 15.1 82 C/C++ C C + + D L L M F C M F C 84 Developer Studio S t u d i o 292 C _ c p l u s

More information

C/C++ - 字符串与字符串函数

C/C++ - 字符串与字符串函数 C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed

More information

ebook50-11

ebook50-11 11 Wi n d o w s C A D 53 M F C 54 55 56 57 58 M F C 11.1 53 11-1 11-1 MFC M F C C D C Wi n d o w s Wi n d o w s 4 11 199 1. 1) W M _ PA I N T p W n d C W n d C D C * p D C = p W n d GetDC( ); 2) p W n

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

untitled

untitled MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12

More information

mfc.doc

mfc.doc SDK 编程讲座 ( 一 ) 摘自 SDK 路报 no.1 ( 电子版 ) Wndows 编程两种方式 : 1.SDK 编程 : 用 C 语言直接调用 Windows API 函数. 这类 API 函数有上千个 ; 2.MFC 编程 : 用类将上述 API 封装起来, 用 C++ 来调用. 一般只需 20 多个 windows 类和另外 20 多个通用的非 windows 类就可 " 干活 " 了.

More information

Microsoft Word - CH07

Microsoft Word - CH07 WSAAsyncSelect 模型開發 WSAAsyncSelect 模型是 Windows Sockets 的一個非同步 I/O 模型 利用該模型應用程式可以在一個 Socket 上, 接收以 Windows 訊息為基礎的網路事件 Windows Sockets 應用程式在建立 Socket 後, 呼叫 WSAAsyncSelect() 函式註冊感興趣的網路事件 當該事件發生時 Windows 視窗收到訊息,

More information

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer

More information

<4D6963726F736F667420576F7264202D2032303130C4EAC0EDB9A4C0E04142BCB6D4C4B6C1C5D0B6CFC0FDCCE2BEABD1A15F325F2E646F63>

<4D6963726F736F667420576F7264202D2032303130C4EAC0EDB9A4C0E04142BCB6D4C4B6C1C5D0B6CFC0FDCCE2BEABD1A15F325F2E646F63> 2010 年 理 工 类 AB 级 阅 读 判 断 例 题 精 选 (2) Computer mouse How does the mouse work? We have to start at the bottom, so think upside down for now. It all starts with mouse ball. As the mouse ball in the bottom

More information

MFC 2/e PDF GBK mirror - anyway solution MFC 1/e MFC 2/e

MFC 2/e PDF     GBK mirror - anyway solution MFC 1/e MFC 2/e 2/e 1998/04 MFC 1/e Windows MFC MFC 2/e 1998/05 1998 UNALIS 3/e 2/e 2/e 3/e 3/e MFC 2/e MFC 3/e MFC MFC 2/e VC5+MFC42 VC6+MFC421 MFC 2/e 1 MFC 2/e PDF http://www.jjhou.com http://expert.csdn.net/jjhou

More information

提纲 1 2 OS Examples for 3

提纲 1 2 OS Examples for 3 第 4 章 Threads2( 线程 2) 中国科学技术大学计算机学院 October 28, 2009 提纲 1 2 OS Examples for 3 Outline 1 2 OS Examples for 3 Windows XP Threads I An Windows XP application runs as a seperate process, and each process may

More information

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

软件测试(TA07)第一学期考试

软件测试(TA07)第一学期考试 一 判 断 题 ( 每 题 1 分, 正 确 的, 错 误 的,20 道 ) 1. 软 件 测 试 按 照 测 试 过 程 分 类 为 黑 盒 白 盒 测 试 ( ) 2. 在 设 计 测 试 用 例 时, 应 包 括 合 理 的 输 入 条 件 和 不 合 理 的 输 入 条 件 ( ) 3. 集 成 测 试 计 划 在 需 求 分 析 阶 段 末 提 交 ( ) 4. 单 元 测 试 属 于 动

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

Panaboard Overlayer help

Panaboard Overlayer help Panaboard Overlayer Image Capture Software for Electronic Whiteboard (Panaboard) ... 3... 5... 6... 13...14 Panaboard Overlayer 1. 2. 3. 4. 4-1. 4-2. [ / ] ( ) 4-3. 5. 6. 6-1. 6-2. [ / ] ( ) 7. Panaboard

More information

新版 明解C言語入門編

新版 明解C言語入門編 328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

Microsoft Word - 11.doc

Microsoft Word - 11.doc 除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何

More information

新・解きながら学ぶC言語

新・解きながら学ぶC言語 330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180

More information

Microsoft PowerPoint - os_4.ppt

Microsoft PowerPoint - os_4.ppt 行 程 資 科 系 林 偉 川 行 程 概 念 行 程 與 程 式 主 要 的 不 同 點 : 程 式 是 被 放 在 外 部 的 儲 存 裝 置 如 磁 碟 上, 而 行 程 則 被 放 在 記 憶 體 中 程 式 在 儲 存 裝 置 中 是 靜 態 的, 而 行 程 在 記 憶 體 中 是 動 態 的, 它 會 隨 著 一 些 事 件 的 發 生 而 產 生 相 對 的 改 變 行 程, 就 是

More information

Computer Architecture

Computer Architecture ECE 3120 Computer Systems Assembly Programming Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Prev: Basic computer concepts

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

More information

bingdian001.com

bingdian001.com 1. DLL(Dynamic Linkable Library) DLL ± lib EXE DLL DLL EXE EXE ± EXE DLL 1 DLL DLL DLL Windows DLL Windows API Visual Basic Visual C++ Delphi 2 Windows system32 kernel32.dll user32.dll gdi32.dll windows

More information

新・明解C言語入門編『索引』

新・明解C言語入門編『索引』 !... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

More information

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - ch6 [相容模式] UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner

More information

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

More information

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf(%d, &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf(% 2013 ( 28 ) ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 10 B 1 C 1 D 5 E 5 F 1 G II 5 H 30 1 2013 C 1 #include 2 int main(void) 3

More information

<4D6963726F736F667420576F7264202D20A6D9A6D7B5E4C159B177AACCB971B8A3BFE9A44AB8CBB86D>

<4D6963726F736F667420576F7264202D20A6D9A6D7B5E4C159B177AACCB971B8A3BFE9A44AB8CBB86D> Journal of China University of Science and Technology Vol.59-2014.04 肌 肉 萎 縮 患 者 電 腦 輸 入 裝 置 Assisted Computer Entry Device for Muscular Atrophy Patient 蔡 樸 生 Pu-Sheng Tsai 中 華 科 技 大 學 電 子 系 副 教 授 Department

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

Learning Java

Learning Java Java Introduction to Java Programming (Third Edition) Prentice-Hall,Inc. Y.Daniel Liang 2001 Java 2002.2 Java2 2001.10 Java2 Philip Heller & Simon Roberts 1999.4 Java2 2001.3 Java2 21 2002.4 Java UML 2002.10

More information

序 软 件 工 程 思 想 林 锐 序 软 件 工 程 思 想 讲 述 软 件 开 发 和 做 程 序 员 的 道 理, 视 野 独 特, 构 思 新 颖, 内 容 风 趣, 不 落 窠 臼, 令 人 耳 目 一 新 堪 称 难 得, 以 至 回 味 无 穷 作 者 从 事 了 八 年 的 软 件 开 发 工 作, 在 他 的 博 士 学 位 论 文 完 成 之 际 写 下 了 这 本 心 之 所 感

More information

(京)新登字063号

(京)新登字063号 教 育 部 职 业 教 育 与 成 人 教 育 司 推 荐 教 材 Java 程 序 设 计 教 程 ( 第 二 版 ) 沈 大 林 主 编 沈 昕 肖 柠 朴 曾 昊 等 编 著 内 容 简 介 Java 是 由 美 国 SUN 公 司 开 发 的 一 种 功 能 强 大 的, 具 有 简 单 面 向 对 象 分 布 式 可 移 植 等 性 能 的 多 线 程 动 态 计 算 机 编 程 语 言

More information

穨complete.PDF

穨complete.PDF 1 2 3 4 1.1 PC 3D -- DirectX 5 1.2 RPG -- VC++ DirectX VC++ DirectX 360 : 6 7 8 9 2.2 10 11 12 13 2.3 14 RPG RPG Map_Struct Map[MAPS] MAPS Scene MakeBackGround() MakeBackGround Blt Blt Windows PatBltpattern

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

More information

概述

概述 OPC Version 1.8 build 0925 KOCRDK Knight OPC Client Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOC_Init...5 2.2.2 KOC_Uninit...5 2.3...5

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor 1 4.1.1.1 (Load) 14 1.1 1 4.1.1.2 (Save) 14 1.1.1 1 4.1.2 (Buffer) 16 1.1.2 1 4.1.3 (Device) 16 1.1.3 1 4.1.3.1 (Select Device) 16 2 4.1.3.2 (Device Info) 16 2.1 2 4.1.3.3 (Adapter) 17 2.1.1 CD-ROM 2 4.1.4

More information

How to Debug Tuxedo Server printf( Input data is: %s, inputstr); fprintf(stdout, Input data is %s, inputstr); fprintf(stderr, Input data is %s, inputstr); printf( Return data is: %s, outputstr); tpreturn(tpsuccess,

More information

51 C 51 isp 10 C PCB C C C C KEIL

51 C 51 isp 10   C   PCB C C C C KEIL http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom

More information

C/C++语言 - 运算符、表达式和语句

C/C++语言 - 运算符、表达式和语句 C/C++ Table of contents 1. 2. 3. 4. C C++ 5. 6. 7. 1 i // shoe1.c: # include # define ADJUST 7. 64 # define SCALE 0. 325 int main ( void ) { double shoe, foot ; shoe = 9. 0; foot = SCALE * shoe

More information

PowerPoint Presentation

PowerPoint Presentation 列 Kernel Objects Windows Kernel Object 來 理 行 行 What is a Kernel Object? The data structure maintains information about the object Process Object: 錄了 PID, priority, exit code File Object: 錄了 byte offset,

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc 2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.

More information

华恒家庭网关方案

华恒家庭网关方案 LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU

More information

科 技 与 法 律 Science Technology and Law Vol.89, No.1, 2011 作 品 若 将 打 字 机 也 算 作 字 体 工 具, 那 么 打 字 机 不 是 美 术 作 品, 只 是 一 种 工 业 产 品 字 帖 是 美 术 作 品 么? 笔 者 认 为,

科 技 与 法 律 Science Technology and Law Vol.89, No.1, 2011 作 品 若 将 打 字 机 也 算 作 字 体 工 具, 那 么 打 字 机 不 是 美 术 作 品, 只 是 一 种 工 业 产 品 字 帖 是 美 术 作 品 么? 笔 者 认 为, 专题研究 计算机字体版权保护 张玉瑞 论计算机字体的版权保护 论计算机字体的版权保护 张玉瑞 中国社会科学院法学研究所 北京 100720 摘 要 对计算机字体产生之单字寻求版权保护 是近来知识产权法律中的热点和难点问题 从字体保护的 国际公约 外国法律及其司法实践看 字体工具属于计算机软件产品 其产生的单字没有版权 社会无关第 三人的使用不构成侵犯书法作品版权 计算机字库是字体工具 不是美术作品

More information

Microsoft Word - 3D手册2.doc

Microsoft Word - 3D手册2.doc 第 一 章 BLOCK 前 处 理 本 章 纲 要 : 1. BLOCK 前 处 理 1.1. 创 建 新 作 业 1.2. 设 定 模 拟 控 制 参 数 1.3. 输 入 对 象 数 据 1.4. 视 图 操 作 1.5. 选 择 点 1.6. 其 他 显 示 窗 口 图 标 钮 1.7. 保 存 作 业 1.8. 退 出 DEFORMTM3D 1 1. BLOCK 前 处 理 1.1. 创 建

More information

目次 

目次  軟 體 工 程 期 末 報 告 網 路 麻 將 91703014 資 科 三 黃 偉 嘉 91703024 資 科 三 丘 祐 瑋 91703030 資 科 三 江 致 廣 1 目 次 壹 前 言 (Preface) P.4 貳 計 畫 簡 述 及 預 期 效 益 (Project Description and Expected Results) P.4 參 系 統 開 發 需 求 (System

More information

ebook12-1

ebook12-1 API N e t B I O S Wi n s o c k A P I Wi n s o c k 1 N e t B I O S Wi n s o c k A P I N e t B I O S O S / 2 D O S 2 3 4 Wi n d o w s Wi n d o w s 1 NetBIOS Network Basic Input/Output System, NetBIOS A P

More information

AP128DG-H AP128DG-H 3 13 ATiRADEON TM Win 98/98SE, WinME Win XP Direct X

AP128DG-H AP128DG-H 3 13 ATiRADEON TM Win 98/98SE, WinME Win XP Direct X Chapter 2 GIGA-BYTE TECHNOLOGY CO, LTD ( GBT ) GBT GBT, GBT 2002 4 12 1 AP128DG-H 1 11 3 12 AP128DG-H 3 13 ATiRADEON TM 8500 4 2 21 5 22 6 23 7 3 31 Win 98/98SE, WinME Win XP 9 311 9 312 Direct X 10 313

More information

untitled

untitled 8086/8088 CIP /. 2004.8 ISBN 7-03-014239-X.... TP313 CIP 2004 086019 16 100717 http://www.sciencep.com * 2004 8 2004 8 1 5 500 787 1092 1/16 16 1/2 391 000 1 2 ii 1 2 CAI CAI 3 To the teacher To the student

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

8idml_20_1_q

8idml_20_1_q Chapter 2 GIGA-BYTE TECHNOLOGY CO, LTD GBT ( ) GBT GBT, GBT 2002 3 15 1 1 11 3 12 AP64D(-H) 3 2 21 4 22 5 23 6 3 31 Win 98/98SE, WinME Win XP 8 311 8 312 Direct X 9 313 11 314 14 315 14 316 18 32 Windows

More information

四川省普通高等学校

四川省普通高等学校 四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9

More information

LSI U320 SCSI卡用户手册.doc

LSI U320 SCSI卡用户手册.doc V1.0 Ultra320 SCSI SCSI 2004 7 PentiumIntel MS-DOS Windows Novell Netware Novell Sco Unix Santa Cruz Operation LSI U320 SCSI SCSI SCSI Integrated Mirroring/Integrated Striping BIOS Firmware LSI U320 SCSI

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

Bus Hound 5

Bus Hound 5 Bus Hound 5.0 ( 1.0) 21IC 2007 7 BusHound perisoft PC hound Bus Hound 6.0 5.0 5.0 Bus Hound, IDE SCSI USB 1394 DVD Windows9X,WindowsMe,NT4.0,2000,2003,XP XP IRP Html ZIP SCSI sense USB Bus Hound 1 Bus

More information

untitled

untitled 1 DBF (READDBF.C)... 1 2 (filetest.c)...2 3 (mousetes.c)...3 4 (painttes.c)...5 5 (dirtest.c)...9 6 (list.c)...9 1 dbf (readdbf.c) /* dbf */ #include int rf,k,reclen,addr,*p1; long brec,erec,i,j,recnum,*p2;

More information

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344> 1. 請 問 誰 提 出 積 體 電 路 (IC) 上 可 容 納 的 電 晶 體 數 目, 約 每 隔 24 個 月 (1975 年 更 改 為 18 個 月 ) 便 會 增 加 一 倍, 效 能 也 將 提 升 一 倍, 也 揭 示 了 資 訊 科 技 進 步 的 速 度? (A) 英 特 爾 (Intel) 公 司 創 始 人 戈 登. 摩 爾 (Gordon Moore) (B) 微 軟 (Microsoft)

More information

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit 6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128

More information

C/C++ - 结构体、共用体、枚举体

C/C++ - 结构体、共用体、枚举体 C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 C C (struct) C 2 C C (struct) C 2 i // book.c: # include < stdio.h> # define MAX_ TITLE 41 # define MAX_ AUTHOR 31 struct book { char title [ MAX_ TITLE

More information

untitled

untitled 不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int

More information

ebook

ebook 3 3 3.1 3.1.1 ( ) 90 3 1966 B e r n s t e i n P ( i ) R ( i ) W ( i P ( i P ( j ) 1) R( i) W( j)=φ 2) W( i) R( j)=φ 3) W( i) W( j)=φ 3.1.2 ( p r o c e s s ) 91 Wi n d o w s Process Control Bl o c k P C

More information

Microsoft Word - 11月電子報1130.doc

Microsoft Word - 11月電子報1130.doc 發 行 人 : 楊 進 成 出 刊 日 期 2008 年 12 月 1 日, 第 38 期 第 1 頁 / 共 16 頁 封 面 圖 話 來 來 來, 來 葳 格 ; 玩 玩 玩, 玩 數 學 在 11 月 17 到 21 日 這 5 天 裡 每 天 一 個 題 目, 孩 子 們 依 據 不 同 年 段, 尋 找 屬 於 自 己 的 解 答, 這 些 數 學 題 目 和 校 園 情 境 緊 緊 結

More information

_汪_文前新ok[3.1].doc

_汪_文前新ok[3.1].doc 普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

[ 13 年 12 月 06 日, 下 午 6 点 24 分 ] Intel Hosts 新 加 入 的 同 学 们, 快 去 听 听 在 线 宣 讲 会 哦, 同 时 完 成 页 面 下 方 有 奖 调 查, 就 有 资 格 参 与 大 奖 抽 取 啦! [ 13 年 12 月 06 日, 下 午

[ 13 年 12 月 06 日, 下 午 6 点 24 分 ] Intel Hosts 新 加 入 的 同 学 们, 快 去 听 听 在 线 宣 讲 会 哦, 同 时 完 成 页 面 下 方 有 奖 调 查, 就 有 资 格 参 与 大 奖 抽 取 啦! [ 13 年 12 月 06 日, 下 午 China Career Fair: To Know a Different Intel Time Participants Chat Transcript [ 13 年 12 月 06 日, 下 午 6 点 00 分 ] Participant Hi [ 13 年 12 月 06 日, 下 午 6 点 00 分 ] Intel Hosts 大 家 好! [ 13 年 12 月 06 日, 下 午

More information

VB程序设计教程

VB程序设计教程 高 等 学 校 教 材 Visual Basic 程 序 设 计 教 程 魏 东 平 郑 立 垠 梁 玉 环 石 油 大 学 出 版 社 内 容 提 要 本 书 是 按 高 等 学 校 计 算 机 程 序 设 计 课 程 教 学 大 纲 编 写 的 大 学 教 材, 主 要 包 括 VB 基 础 知 识 常 用 程 序 结 构 和 算 法 Windows 用 户 界 面 设 计 基 础 文 件 处

More information

ch08.PDF

ch08.PDF 8-1 CCNA 8.1 CLI 8.1.1 8-2 8-3 8.1.21600 2500 1600 2500 / IOS 8-4 8.2 8.2.1 A 5 IP CLI 1600 2500 8-5 8.1.2-15 Windows 9598NT 2000 HyperTerminal Hilgraeve Microsoft Cisco HyperTerminal Private Edition (PE)

More information

User’s Manual

User’s Manual V7 用 户 手 册 亿 图 为 您 专 业 图 表 设 计 提 供 最 佳 解 决 方 案 2004-2014 EdrawSoft. All right reserved. Edraw and Edraw logo are registered trademarks of EdrawSoft. 目 录 亿 图 怎 样 优 越 于 其 他 软 件... 5 亿 图 7 个 新 功 能... 6 为

More information

ebook140-8

ebook140-8 8 Microsoft VPN Windows NT 4 V P N Windows 98 Client 7 Vintage Air V P N 7 Wi n d o w s NT V P N 7 VPN ( ) 7 Novell NetWare VPN 8.1 PPTP NT4 VPN Q 154091 M i c r o s o f t Windows NT RAS [ ] Windows NT4

More information

CH01.indd

CH01.indd 3D ios Android Windows 10 App Apple icloud Google Wi-Fi 4G 1 ( 3D ) 2 3 4 5 CPU / / 2 6 App UNIX OS X Windows Linux (ios Android Windows 8/8.1/10 BlackBerry OS) 7 ( ZigBee UWB) (IEEE 802.11/a/b/g/n/ad/ac

More information

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc TwinCAT 2001.12.11 TwinCAT 1. TwinCAT... 3 2.... 4... 4...11 3. TwinCAT PLC... 13... 13 PLC IEC 61131-3... 14 4. TwinCAT... 17... 17 5. TwinCAT... 18... 18 6.... 19 Maschine.pro... 19... 27 7.... 31...

More information

Microsoft Word - 正文.doc

Microsoft Word - 正文.doc 1 2 1 2 3 4 5 6 7 8 9 10 3 1 150 2 150 1 1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.4 1.4.1 CPU 1.4.2 I/O 1.4.3 I/O 1.5 1.5.1 CISC RISC 1.5.2 1.5.3 1.6 1.6.1 1.6.2 N 1.6.3 2 2.1 2.1.1 2.1.2 2.1.3

More information

Microsoft Word - 小心翼翼的二十一點N.doc

Microsoft Word - 小心翼翼的二十一點N.doc 投 稿 類 別 : 資 訊 類 篇 名 : 小 心 翼 翼 的 二 十 一 點 作 者 : 陳 鈺 文 國 立 瑞 芳 高 級 工 業 職 業 學 校 資 訊 二 李 伯 謙 國 立 瑞 芳 高 級 工 業 職 業 學 校 資 訊 二 胡 家 媛 國 立 瑞 芳 高 級 工 業 職 業 學 校 資 訊 二 指 導 老 師 : 周 曉 玲 老 師 陳 思 亮 主 任 壹 前 言 一 研 究 動 機 平

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

教育部高等学校教学

教育部高等学校教学 i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2007 2008 2009 13 2007 50 98 6 38 1 13 8 1 2 20 8 3 1000 2010 1000 13 13 1 20 80 1984 25 8 21 2 1 1 26 1 5 1 3 2 1987 4.5 2 9.5 13.5 3 1 2 1990 9 3 22

More information

untitled

untitled 1 5 IBM Intel 1. IBM 第 1/175 页 第 2/175 页 第 3/175 页 80 第 4/175 页 2. IBM 第 5/175 页 3. (1) 第 6/175 页 第 7/175 页 第 8/175 页 = = 第 9/175 页 = = = = = 第 10/175 页 = = = = = = = = 3. (2) 第 11/175 页 第 12/175 页 第 13/175

More information

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 範 例 試 題 (C++) 試 題 編 號 :11900-920201-4 審 定 日 期 : 94 年 7 月 1 日 修 訂 日 期 : 96 年 2 月 1 日 97 年 1 月 30 日 ( 第 二 部 份 ) 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 應 檢 參 考 資 料 壹 試

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

学习MSP430单片机推荐参考书

学习MSP430单片机推荐参考书 MSP430 16 MSP430 C MSP430 C MSP430 FLASH 16 1 CPU 16 ALU 16 PC SP SR R4~R15 2 3 00-FFH 100-1FFH 4 5 1 2 51 24 27 6 1 2 3 4 5 6 4 12 SR SP SR CPU SR CPU C Z N GIE CPUOff CPU OscOff SCG0 SCG1 CPU EXIT SP

More information

Junos Pulse Mobile Security R1 2012, Juniper Networks, Inc.

Junos Pulse Mobile Security R1 2012, Juniper Networks, Inc. Junos Pulse Mobile Security 4.0 2012 6 R1 2012, Juniper Networks, Inc. Junos Pulse Mobile Security Juniper Networks, Inc. 1194 North Mathilda Avenue Sunnyvale, California 94089 408-745-2000 www.juniper.net

More information