|
hi all,
I have a round dialog, i use the OnColorCTL to color the background of the dialog to yellow. i use OnPaint and dc.TextOut to display text on the round dialog. also i want to draw an ellipse as a mark for the round dialog border
here is the code i use in the OnPaint():
void CRoundDlg::OnPaint()
{
CPaintDC dc(this);
CRect rect,rectTmp;
GetWindowRect(rect);
ScreenToClient(rect);
rectTmp = CRect(rect.left + 17 * SPACE_MARGINGS,
rect.top + 23 * SPACE_MARGINGS,
rect.Width(),
rect.Height());
CBrush* pOldBrush = dc.SelectObject(&m_brush);
dc.SetBkColor(MESSAGE_BOX_DIALOG_BK_COLOR);
dc.SetTextColor(MESSAGE_BOX_TEXT_COLOR);
dc.TextOut(rectTmp.left,rectTmp.top,m_szText);
dc.PatBlt(0, 0,rect.Width(),rect.Height(), PATCOPY);
CPen* pOldPen= dc.SelectObject(&m_Pen);
rect.DeflateRect(4,4,4,4);
dc.Ellipse(rect);
dc.SelectObject(pOldBrush);
dc.SelectObject(pOldPen);
}
trouble is that i see the rectangle but i don't see the text.....
can any1 help here?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Looks like you are painting over the text, dude!
Swap the order of the TextOut and the PatBlt and you should see it.
|
|
|
|
|
thanks that helped me...but only when i moved it after the ellipse drawing...
thanks again
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Try moving the dc.TextOut() after the PatBlt(), or even later still. FYI I use a rounded dialog in ED without any problems.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
thanks that helped me...but only when i moved it after the ellipse drawing...
thanks again
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Anyone here knows how to calculate pi in visual c++ 6 to the 100ths maybe less maybe more. I just want to know how maybe an example but I would appreciate a method.
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
|
Ted Ferenc wrote:
as the saying goes http://www.anvari.org/fun/Computer/Bart_Uses_Google.html
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Pick your favorite algorithm and do it yourself!
There are enough ready algorithms written in C/C++, just do a google search.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
PI/4=1-1/3+1/5-1/7+1/9-1/11.....
|
|
|
|
|
hi all,
I know the STL class deque is a sort of a sorted vector.
i have a data class as follows:
class CMyData
{
public:
CString m_szStr1;
CString m_szStr2;
}
then i insert this data class to the deque as follows:
m_deque.push_back(pMyData);
what do i need to write to determine the sorting rule??? according to what the deque sorts its elemets???
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Actually, a std::deque is not like a sorted vector -- it's a vector that has constant time insertion/removal from both ends (instead of just the end). The name "deque" means "double-ended queue".
http://www.sgi.com/tech/stl/Deque.html[^]
If you want a sorted collection, use a std::set .
- Mike
|
|
|
|
|
hi,
thanks for the reply, i know understand what you mean....
i can't use set because i can allow duplicated items....what else can u suggest?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
|
thanks a lot man
that helped me!
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Is it possible to easily wrap a popup menu into multiple columns. I would like something like the Start menu on Windows XP, but haven't been able to determine if this is a non-standard menu that Microsoft has implemented. I don't see anything in the SDK documentation to select between scrolling or wrapping popup menus.
Thanks.
Neal Stublen
http://www.awesoftware.com
|
|
|
|
|
You may be able to get somewhere using Owner Draw menus, other than that I think you are on your own.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Now, maybe its because its Monday, or maybe I truely am a dumbass; But I've got a bit of a problem code involving string pointers.
Let me explain: I've got a function that constructs a string and returns:
LPCTSTR CSomeClass::GetSerialString()
{
std::ostringstream strstream;
strstream<< std::setfill((TCHAR)'0')<<\
std::setw(5)<<m_nSerial;
strstream<<std::flush;
ASSERT( (strstream.str()).length() == 5 );
return (strstream.str()).c_str(); }
}
Whenever this function is called using the following code:
string strSerial;
strSerial = GetSerialCodeString();
The strSerial variable points to an invalid string array, even though at the point of tracing, the GetSerialString function contains the correct string.
Can someone explain why the LPCTSTR return value gets destroyed?
I Dream of Absolute Zero
|
|
|
|
|
Can someone explain why the LPCTSTR return value gets destroyed?
Because the LPCSTR returned is a pointer to the internal string of strstream , and strstream (and its asocciated string ) is destroyed as soon as GetSerialCodeString exits. Use a smarter data type like string itself:
std::string CSomeClass::GetSerialString()
{
return strstream.str();
}
...
string strSerial;
strSerial=GetSerialCodeString(); This ought to work because string has an overloaded copy constructor that takes care of safely moving the internal resources between objects.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
cheers dude!
I Dream of Absolute Zero
|
|
|
|
|
In the windows right corner there is a set of icons which represents some application running on PC. How can I add a new icon to this set, how can I interact with this one?
Thanks
Telecommunication Engineer.
He works from more than 3 years as a software consultant over distributed systems developed in C++ or Java and based on a CORBA or DCOM tecnology. Knowledge of relationship and object DB
|
|
|
|
|
|
|
hello sir
I have written a MAPI client program in C++..
what all softwares do i need to install for this program to run..
is visual studio enough..
or is there anyother simple software for MAPI to get executed??
actually i have to run tihs porgram in a fresh machine..what al softwares do i need for tis C++ MAPI client to run onthe fresh machine??
do i needto install microsoft exchange server too..coz' i remember reading somewhere that
"The information here only applies to MAPI client applications that access Exchange."
what else do i need to install for my program to run??
ranjani
|
|
|
|
|
Hi,
You pass mapi questions during last month
To install mapi you need register Msmapi32.ocx using
regsvr32.
In some casees you will need to have file Msmapi.srg with
licenses.
Vitali
http://www.creative-case.com[^]
|
|
|
|