views:

63

answers:

2

hello!

Whats the most simple way (without much fancy stuff and no big setup overhead) to create a c++ project with visual studio where i can create some graphical debug output? (mainly drawing some lines, circles and triangles in a window. doesn't have to be performant or look pretty)

thanks!

A: 

The quickest way: create a new project, find or create the paint message handler (in Win32 it'll be in WndProc under "case WM_PAINT:", and in a WinForms (.net) project you'll override OnPaint), and add code to draw some stuff.

cHao
A: 

Well, for this I'll assume you would want to just use Gdi.

In a windows app, process the WM_PAINT message.

Here is an example that draws a rectangle:

case WM_PAINT: { HDC hDC; PAINTSTRUCT ps; hDC = BeginPaint(hwnd,&ps); Rectangle(hDC,10,10,30,30); EndPaint(hwnd,&ps); }

Alexander Rafferty