I am trying to simply draw a line on to a small window.
(as the form.canvas.drawline() function would do in Delphi).
I am using MS VC++ 6 and am developing on Win 2K
So far I have:
const char *szWndClass = "DrawLine";
const char *szProgramName = "Draw Line";
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = MsgProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH )GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = szWndClass;
hWnd = CreateWindowEx(WS_EX_TOPMOST,
WS_OVERLAPPEDWINDOW, 0, 0,
320, 240, NULL, NULL, hInstance,
hDC = GetDC(hWnd);
When I try to compile this, it thows up an error that the right of MoveTo and LineTo must point to class/struct/union.
I don't need to do anything more than draw a few lines on the screen and it doesn't have to be fast so would rather not get in to OpenGL or DirectDraw if possible.