|
That works in VS7, OP asked for VC6. AFAIK there is no word wrap option in VC6.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Ugh, you're right. Note to self: do not post replies before executing bootstrap caffeination.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
hi there,wonderful guys.
i think i have to commend everyone in this judicious forum for doing a nice and pleasing job.
hello,is there any body in this forum who could assist me to use vc++ in writing program on clock which will be functioning exactly the way clock work.
pls i need respond to this question on time for the completion of a project i have at hand now,
you can as well email me for my better understanding.
thanks.
prince_kolly@yahoo.com
|
|
|
|
|
princekolly wrote:
hello,is there any body in this forum who could assist me to use vc++ in writing program on clock
Yes, several.
princekolly wrote:
pls i need respond to this question on time for the completion of a project i have at hand now,
Smells like homework. Please elaborate.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Do you want to create a Digital clock or Analog clock?
For Analog, you need to do some mathematics. HeHe. Now you are stuck!
this is this.
|
|
|
|
|
khan++ wrote:
Do you want to create a Digital clock or Analog clock?
Neither. I've no desire for a clock.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
Smells like homework. Please elaborate.
Why did I have the image of a baddie in a film smiling slowly as he turns to the next victim ?
British of course, british actors make much better baddies than american actors.
The tigress is here
|
|
|
|
|
princekolly wrote:
writing program on clock
How much have you coded till NOW?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
I don't think you're going to get much help with an "email me for better understanding" post. This forum is not meant for people to do other's work. Rather we help people who are facing specific problems that they've defined during their development.
Do you have a specific question or are you looking for someone to basically write your application for you?
|
|
|
|
|
Is there a way to access things like my video capture card without directx?
|
|
|
|
|
|
Im outputing some simple text to a view using CScrollView and i encountered something that I found to be very odd. When I use this code control the size of the scrollbars it cuts off some of the text.
CRAWConversionScrollDoc* pDoc = GetDocument();<br />
ASSERT_VALID(pDoc);<br />
<br />
CRect rTextSize;<br />
rTextSize.SetRect( 0, 0, 800, 1200 );
this->GetDC()->DrawText( *(pDoc->GetConvertedData()), &rTextSize, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT );<br />
<br />
CSize sizeTotal;<br />
sizeTotal.cx = rTextSize.Width();<br />
sizeTotal.cy = rTextSize.Height(); <br />
CScrollView::SetScrollSizes(MM_TEXT, sizeTotal);
however when I modify the code to proportionaly resize the scrollbars like so it works just fine
CRAWConversionScrollDoc* pDoc = GetDocument();<br />
ASSERT_VALID(pDoc);<br />
<br />
CRect rTextSize;<br />
rTextSize.SetRect( 0, 0, 800, 1200 );
this->GetDC()->DrawText( *(pDoc->GetConvertedData()), &rTextSize, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT );<br />
<br />
CSize sizeTotal;<br />
sizeTotal.cx = rTextSize.Width() + ((double)rTextSize.Width()/1.6);<br />
sizeTotal.cy = rTextSize.Height() + (rTextSize.Height()/8);<br />
<br />
CScrollView::SetScrollSizes(MM_TEXT, sizeTotal)<code><br />
<br />
What im wondering is the reason for this behavior. With the modified code my text comes out properly regrardless of how much text there is be it 1 page or 50+ pages.<br />
<br />
Any help with this would be appreciated<br />
-thx
|
|
|
|
|
The code you posted will measure the text based on the default font. Are you using a different font when drawing the text?
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Yes I am using a different font, I guess I will just change the font before I measure, thx for the help
|
|
|
|
|
I have an Edit box on a dialog and check the input and arrange for it to be set to the Max or Min value if data entered is out of range.
But I get a Stack Overflow error if say I enter say 999, the routine set the input to 180 which is OK. But I now enter -999 and the stack overflow problem occurs and I dont know why.
The Event Routine on the Edit box is show below:-
#define Value_MAX 180
#define Value_MIN -180
void CDataInput::OnEnChangeValue()
{
m_cValue.GetWindowText(m_strEditValue);
m_fValue = atof(m_strEditValue.GetBuffer());
if(m_fValue > Value_MAX)
{
m_fValue = Value_MAX;
g_strNewDataStr.Format("%0.2f", m_fValue);
m_cValue.SetWindowText(g_strNewDataStr);
}
else if(m_fValue <= Value_MIN)
{
m_fValue = Value_MIN;
g_strNewDataStr.Format("%0.2f", m_fValue);
m_cValue.SetWindowText(g_strNewDataStr);
}
}
Also if I just enter -999 I get the Stack Overflow problem.
Can someone explain what I am doing wrong.
grahamfff
|
|
|
|
|
Your SetWindowText is generating another EN Change event, you never get out of the loop!
You could maybe set yourself a monitor variable, like m_bInEnChange, and if that is TRUE, don't do your own processing again!
You are probably also in trouble because you have the
else if(m_fValue <= Value_MIN)
which will always be true once you set value to Value_MIN, so you get into recursive loop.
|
|
|
|
|
Rather than validating on the EN_CHANGE notification, try using the EN_KILLFOCUS notification. With EN_CHANGE, your user will get very frustrated trying to enter a valid value. Every keypress, you will try and validate what they are entering. With EN_KILLFOCUS, you validate only when they leave the control (which implies they are ready to commit the value).
Software Zen: delete this;
|
|
|
|
|
Something else: You don't need to call m_strEditValue.GetBuffer() in your atof() function call. Just pass m_strEditValue , and the built in cast to a LPCTSTR will take care of the required conversion.
Something else #2: In other circumstances, if you have to use GetBuffer() with a CString value, make sure you call ReleaseBuffer() . This ensures that the CString manages the buffer memory correctly.
Software Zen: delete this;
|
|
|
|
|
Thanks will use OnKillFocus, works better that way.
Graham.
grahamfff
|
|
|
|
|
I tried several times to get Diablo 2's window, came up with nothing... all I need is some insite on what to do. I image it would be the same for putting a label inside it, as it is in regular windows. Am I right? If perhaps, you need more info. then please let me know, by replying...
Thanks for replying, when you do!
Programmer_4_Fu73r
|
|
|
|
|
I am studying to use the DirectDraw, have what can I help?
I come from China, is a plait distance raw recruit.My English level is badly.
|
|
|
|
|
I have a property page with 4 tabs. How do I gray out a particular tab at run time.
Similarly my application (generated from MDI Doc -View Architecture) has
the SAVE icon.
This icon is enabled throught the application.I want it to be enabled only when changes are done to my application.How do i do this.
Any suggestions please.
Thanx in advance
laiju
|
|
|
|
|
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
I have 2 threads that for some reason lock up and I can't figure out why. Maybe if someone could look at some of my code they can see something obviously wrong:
<br />
UINT CChildView::CaptureThread()<br />
{<br />
bool ShutterChanged = false;<br />
int saveShutter;<br />
while(!m_bTerminateThread)<br />
{<br />
if (m_bCapturePaused)<br />
{<br />
::SetEvent(m_hCapturePausedConfirm);<br />
switch(::WaitForSingleObject(m_hCaptureEvent, 5000))<br />
{<br />
case WAIT_OBJECT_0:<br />
break;
case WAIT_TIMEOUT:<br />
continue;
}<br />
}<br />
...rest of the thread<br />
Note that inside this thread I use an object which implements CCriticalSection object that I lock and unlock for each function. Both the GUI thread and this thread calls functions on this object.<br />
}<br />
Furthermore I define:<br />
inline void StartCapture()<br />
{<br />
m_bCapturePaused = FALSE;<br />
::SetEvent(m_hCaptureEvent);<br />
::ResetEvent(m_hCapturePausedConfirm);<br />
}<br />
inline void PauseCapture()<br />
{<br />
m_bCapturePaused = TRUE;<br />
::ResetEvent(m_hCaptureEvent);<br />
::WaitForSingleObject(m_hCapturePausedConfirm, INFINITE);<br />
}<br />
The problem is in the main program when the user clicks a button I want to pause the thread. The deadlock doesn't occur always. Also any runs through the debugger work, so I don't know how to solve this problem.
Thanks.
|
|
|
|