i am currently learning VC++ with MFC. But i am quite confused now. My dilemma is whether to use structures (which i guess are used extensively at Win32 API level) or their equivalent MFC objects.
let me elaborate it. For example i want an array of points to use it somewhere. I gathered that i have two options to do so - either to use POINT structure array or array of CPoint objects. Now, which one should i use?
Being MFC programming should i stick to CPoint or should i take the liberty to use POINT array? Note that i dont have any use of supposed member functions of CPoint in case if i should use it..
Same goes with some other things like RECT and CRect.
So please throw some light on this.. :|
Another question :
i am also quite confused with the use of GDI function ::GetStockObject(). Being a non-MFC function (i guess so), i think it shouldnt be used much around an MFC code.
But i need to use it at certain points like :
Frame::Frame() // Frame::CFrameWnd class
{
HBRUSH brush;
brush = (HBRUSH) ::GetStockObject (WHITE_BRUSH);
LPCTSTR className;
className = AfxRegisterWndClass (NULL, AfxGetApp()->LoadStandardCursor(IDC_CROSS),
brush,
AfxGetApp()->LoadStandardIcon(IDI_ERROR));
Create (className, "XYZ");
}
i think the another way might go like this (using CBrush):
Frame::Frame()
{
defaultCursor_ = AfxGetApp()->LoadCursor (IDC_CURSOR1);
// defaultBrush_ = (HBRUSH) ::GetStockObject (WHITE_BRUSH);
defaultIcon_ = AfxGetApp()->LoadStandardIcon (IDI_ERROR);
// here defaultBrush_ is : CBrush defaultBrush_;
defaultBrush_.CreateSolidBrush(RGB (0,0,255));
HBRUSH tempBrush;
tempBrush = (HBRUSH) defaultBrush_;
LPCTSTR className;
className = ::AfxRegisterWndClass (NULL, defaultCursor_, tempBrush, defaultIcon_);
Create (className, "BHOOT");
}
so which way to follow here? Should i take the liberty of using GetStockObject?
or am i just confusing myself here? Is there any other better way out?
please help me. :|