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:
#include <afxwin.h>
const char *szWndClass = "DrawLine";
const char *szProgramName = "Draw Line";
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wc;
HWND hWnd;
MSG msg;
HRESULT hr;
HDC hDC;
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;
RegisterClass(&wc);
hWnd = CreateWindowEx(WS_EX_TOPMOST,
szWndClass, szProgramName,
WS_OVERLAPPEDWINDOW, 0, 0,
320, 240, NULL, NULL, hInstance,
NULL);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
hDC = GetDC(hWnd);
hDC.MoveTo(10,10);
hDC.LineTo(100,100);
.
.
.
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.
Thank you