Right now I have some problems.
My first is the Win32 menu. I'm creating a window using the Win32 API and every time I press alt, the menu you get when you click on the program icon on the titlebar comes up, but invisible. Is there a way to stop this behaviour while keeping the ability to use the alt key?
As for templated rectangles, I have 'art->drawRect(CRectU16(0, 0, height, width), 0, 0, 0, 0, 0, 0);' which can be seen creating a rectangle using four ints (I have ints typedefed in my engine for portability).
CRect(T BLCX, T BLCY, T TRCX, T TRCY)
{
BLC = CVector2D<T>(BLCX, BLCY);
TRC = CVector2D<T>(TRCX, TRCY);
}
Seen there, it creates two vectors to serve as it's corners using the ints. Vectors are templated classes too. But I get 'no matching function for call to `CVector2D<u16>::CVector2D()'.' as an error. What am I doing wrong?
Last but not least, is there a good way to do word wrapping on strings by words and width so I words don't get cut off in the middle?
[QUOTE=CPPNOOB;21224911]But I get 'no matching function for call to `CVector2D<u16>::CVector2D()'.' as an error. What am I doing wrong?
Last but not least, is there a good way to do word wrapping on strings by words and width so I words don't get cut off in the middle?[/QUOTE]
Looks like it can't find a default constructor for CVector2D. You can fix the error by supplying a default constructor, but really you should be using the initialisation list, like so:
[CPP]
CRect(T BLCX, T BLCY, T TRCX, T TRCY) :
BLC(BLCX, BLCY),
TRC(TRCX, TRCY)
{
}
[/CPP]
Thanks to my knowledge (or lack of) of C++, I didn't think you could do that. Anyway, that fixed that problem.
Sorry, you need to Log In to post a reply to this thread.