|
I got it!
It's set up to send EXE files to a different directory.
Thanks!
Yonggoo
|
|
|
|
|
Hello !
I have a form (CViewForm derivative) with two controls:
1. edit control
2. button control
I would like to click a button to enter some text to edit box, but I don't want the edit box to lose a focus.
Now, if I click a button, edit box is properly updated, but it loses focus (the button becomes focused).
Does somebody know if it is any way to make a button (or any other control) "unfocusable" (but not by disabling it, it should properly response to mouse clicks) ?
I hope somebody knows
Regards,
WTL
|
|
|
|
|
add to the editbox a WM_KILLFOCUS handler.
it will be called each time the edit looses focus.
inside the handler, call WM_SETFOCUS ...
|
|
|
|
|
you can to add style Edit WS_POPUP with ModifyStyle but this way one problem
that all messages post to edit and you can use Alt+F4 for close edit
else dont work with buttons or controls in the form
|
|
|
|
|
Thanks for your advice !
I have try the first one, but I should make changes (add message hendler) to every "focusable" object existing in a box (in real life there is more controls than in my sample ). Second one unfortunately doesnt fit my needs...
Now I'm playing with MA_NOACTIVATE (OnMouseActivate), with only partial success...
|
|
|
|
|
you're welcome Wojciech Litwin
your question is attractive and I hope that you find your answer early.
I tested your question,But I think my information is poor.
Have a nice day
|
|
|
|
|
Hi,
I have a little problem converting a string to a number.
Situation:
string : "1.555,23"
thousand seperator = "."
decimal seperator = ","
Why doesn't this help?
<br />
lconv* pConv = localeconv();<br />
pConv->decimal_point = ",";<br />
pConv->thousands_sep = ".";<br />
Using the default "C-locale", things get messed up.
How can I make sure it uses the (above) seperators so i get correct conversion?
Best regards,
Jens
|
|
|
|
|
JensB wrote: I have a little problem converting a string to a number.
Use atoi() or atof() .
Use localeconv() to get information about the locale settings. Use setlocale() to set, change, or query some or all of the current program locale information. So are you trying to get or set information? Why aren't you using GetLocaleInfo() and SetLocaleInfo() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
How to know the length (in pixel) of a text string in a CStatic object?
It isn't sure that the current displayed text is the text on interest.
[Seemes that pStatic->GetDC()->GetOutputTextExtent("bye bye") isn't the right way]
thanks
Have a nice code day
|
|
|
|
|
What about CDC::GetTextExtent()?
|
|
|
|
|
I get the same values in boh cases,
but far from the real length!
Have a nice code day
|
|
|
|
|
I get the same values in both cases,
but far from the real length!
Have a nice code day
|
|
|
|
|
Why do you need to know the width of a string in pixels?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have a dynamic dialog, and sometimes the text is too large!
So, I was thinking to resize it, but I need to know the text length!
Any tips?
thanks.
Have a nice code day
|
|
|
|
|
So if you have text that is 1025 pixels wide on a 1024x768 monitor, will the dialog therefore go off the edge of the screen?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
You might have to use CDC::GetOutputTextMetrics() along with GetTextExtentExPoint() . Add size.cx and tm.tmAveCharWidth together to see what that produces. Don't forget to select the static control's font into the DC before taking any measurements.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: select the static control's font into the DC
Great!!
Now it works!
Thank for your time.
Have a nice code day
|
|
|
|
|
Just a suggestion, you can wrap text in a static control.
Nibu thomas
Software Developer
|
|
|
|
|
I have a VC++ MFC application in VS 2005. In this application I use CPropertySheet's in several locations. The program works fine for a while, but at some point the CPropertySheet's stop working, in such a way that when I click on a CPropertyPage tab, the tab for that sheet disappears completely or the controls on that CPropertyPage are all invisible. I'm guessing that I'm running out of resources, handles, memory, etc.
Can somebody advise me on what to look for in the way of resources or memory, so that I can circumvent this problem? Also, what utilities would be useful to diagnose the problem? At the very least, I'd like to have the program detect the problem and warn the user to save their results.
Thanks
B Jacobs
-- modified at 14:41 Wednesday 8th March, 2006
|
|
|
|
|
hi
i have a small app im putting together. i have put in a "IP Address" box and have a button then when click will store the ip address.
from what i can see you use CIPAddressCtrl::GetAddress to get this address, what am i doing wrong below? I am using vc++6.
BYTE nField0, nField1, nField2, nField3;
int rc = CIPAddressCtrl::GetAddress(nField0, nField1, nField2, nField3);
should that not put the address into each one of those byte fields?
i am getting an error as below..
error C2352: 'CIPAddressCtrl::GetAddress' : illegal call of non-static member function.
afxcmn.h(1112) : see declaration of 'GetAddress'
please help
thanks
|
|
|
|
|
GetAddress() is not a static member. It must be called in the context of a CIPAddressCtrl object. Use ClassWizard to associate the control with a CIPAddressCtrl object.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
many thanks for the reply
can you further explain this as MFC is new to me?
thansk again
|
|
|
|
|
keithlee wrote: can you further explain this as MFC is new to me?
Which part? Use Ctrl+W to open ClassWizard. Click the Member Variables tab. Select the desired control and click the Add Variable... button.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
stupid me!! i had that already done with out knowing it
m_strIP2.GetAddress(nField0, nField1, nField2, nField3);
did the trick then
thanks for your help
|
|
|
|