How to make a simple drawing?
Here i post the code of a simple function. I want it to create a window and draw a circle in it, but i can't make it. :confused:
[code]
HWND initEditor(HWND hMainWnd) {
HWND hewnd;
HDC hDispl;
PAINTSTRUCT *lpPaint;
hewnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szEditClassName,
"Test Window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 500, 350,
hMainWnd, NULL, g_hEdInst, NULL);
ShowWindow(hewnd, SW_SHOWNORMAL);
UpdateWindow(hewnd);
hDispl = BeginPaint(hwnd, lpPaint);
Ellipse(hDispl, 10, 10, 15, 15); // this should draw a circle!!!!
EndPaint(hwnd, lpPaint);
}
[\code]
Probably there's something wrong with it, but i can't find anything wrong...
Thanks
Can you post the full code
Can you post the full code because if find some words that should not be there. One of them is the hwnd of the window. Because you are not drawing the ellipse in "WndProc" you dont have any "hwnd". Use "hewnd" because that is what you put for your windows' hwnd.
Just post the full code here and i may be able to fix it for you
what is rong with that source code
What is rong with that code. I did not find any mistake mistake but also I am not at home so I have not tested it. When I test, I will just see what is rong with that.
PS: Why do you need the resource files except the resource menu file.