I'm using eVC++ and MFC. I want to add a window or control, that I can draw into, to a tab control thats on a formview. I'm going to draw a graph into the window or control and need horizontal scrolling capabilities in it.
As a first try, I created a new class (CDrawingWnd) derived from the generic CWnd. I overrode OnPaint to do my drawing. I then created a custom control on the tab and set the Class of the custom control to CDrawingWnd.
It didn't work. I realized I probably need to register a new window class and set that as my class in the custom control... or... create the window programmatically instead of adding a custom control in a template.
Am I even on the right track? Is there a better way. I'd rather spend the time working on the logic of my app then trying to figure out the best way to do a drawing window. Can you just use a static or edit control and get its DC and start drawing?
If this isn't the right track, just point me towards it and I'll figure out the details. Thanks in advance.
Tom
As a first try, I created a new class (CDrawingWnd) derived from the generic CWnd. I overrode OnPaint to do my drawing. I then created a custom control on the tab and set the Class of the custom control to CDrawingWnd.
It didn't work. I realized I probably need to register a new window class and set that as my class in the custom control... or... create the window programmatically instead of adding a custom control in a template.
Am I even on the right track? Is there a better way. I'd rather spend the time working on the logic of my app then trying to figure out the best way to do a drawing window. Can you just use a static or edit control and get its DC and start drawing?
If this isn't the right track, just point me towards it and I'll figure out the details. Thanks in advance.
Tom