|
I heared that google is a friend but does MSDN new friend?;P
|
|
|
|
|
You already have a message below with the same question. If you have answered which format are you using, you don't have to ask againg including the format. Just wait for an answer in your first message.
Read the good answer of toxcct or mine to the message of snoop82
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
1) you spam the boards, so, this question have been marqued as SPAM.
2) you abuse the forum, so, your first question have been marqued so too.
3) use a correct english. people here are not all native english and it's already dificult enough to express themselves in a language that's not their mother tongue, so don't force them to guess which words you're typing.
4) no one here answer for money. we all belong to this forum for the pleasure, so we're not obliged to answer.
5) ask a specific question. don't expect us to do your homework.
6) use the html tags provided to format the messages correctly. a code sample should be placed in <pre></pre> blocks. use <code></code> to highlight som words if you like.
7) don't post a huge piece of code like you did. no one will read it, and worst, you give us a bad side of yours.
8) when you have an error, provide the relevant error message.
9) and never forget to tell what you already tried to go around the problem you got...
SO, please, delete these 2 questions immediately, and re ask like you would expect someone to ask a question if you had to answer it
-- modified at 5:44 Thursday 20th September, 2007
>>Thank you.
|
|
|
|
|
|
Programm3r wrote: 10) And never forget to thank the person you helped you
seems like he did[^]...
|
|
|
|
|
Yes... but... without reading all[^] :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
|
Hi.
I set my dialog color to black with GetStockObject( BLACK_BRUSH ); , then I put edit control with different 'BkColor'
CDC *pEditDC=m_edtInfo.GetDC();<br />
pEditDC->SetBkColor(RGB(230,251,251));<br />
pEditDC->SetTextColor(RGB(255,255,255));<br />
ReleaseDC(pEditDC);
When my dialog shows at first (before my edit control has no input string) I don't even see it (all dialog is black)! When I populate edit control m_edtInfo.SetWindowText('some text') text is displayed and edit ctrl's BkColor is shown but only behind the text not on all edit ctrl rectangle.why?
How to get all edit ctrl's region being filled with BkColour, even at first?
Thanks!
P.S.
My apology for my language.
|
|
|
|
|
Trying to set the back colour like this will not work. You need to override WM_CTLCOLOR in the dialog class to change the colours of the dialog itself and its controls.
|
|
|
|
|
Thanks for replay.
I'm already overriding that:
HBRUSH CDialList::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if( nCtlColor == CTLCOLOR_DLG )<br />
{<br />
m_myHbr = (HBRUSH) GetStockObject( BLACK_BRUSH ); <br />
}<br />
return m_myHbr;<br />
}<br />
for setting my dialog color to black!
You are saying I can put more code on it and deal with color for my edit ctrl.
Ok I put additional line code (if statement):
if( nCtlColor == CTLCOLOR_EDIT )<br />
but can you tell me what to use to set color to RGB value and not to use GetStockObject?
Thanks!
|
|
|
|
|
This is how it looks now:
<br />
HBRUSH CDialList::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if( nCtlColor == CTLCOLOR_DLG )
{<br />
m_myHbr = (HBRUSH) GetStockObject( BLACK_BRUSH ); <br />
}<br />
if( nCtlColor == CTLCOLOR_EDIT )
{<br />
CDC *pEditDC=m_edtInfo.GetDC();<br />
SetTextColor(*pEditDC,RGB(255,255,255));<br />
m_myHbr = (HBRUSH) pEditDC->SetBkColor(RGB(230,251,251));<br />
ReleaseDC(pEditDC);<br />
}<br />
return m_myHbr;<br />
}<br />
But unfortunate still doesn't work!?!
|
|
|
|
|
You shouldn't be getting a DC for the control.
Everything you need is passed to your OnCtlColor() method.
You should use the passed DC.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Easiest would be if you look into one of the controls shown in the Editcontrol-section of codeproject[^].
You will find a lot of source code to look how it is done.
Chris Losinger has made a coloring Editcontrol I use.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
You can get the whole rectangle with void CEdit::GetRect( LPRECT lpRect ) const; and insteads of set the background of the CEdit, do it with the lpRect.
Then use the CDialog::OnInitDialog (); to make your changes and...
remember to change the background of the dialog before changing/filling the edits
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
can anybody tell me what is the vc++ euivalent of the foloowing c# code
n = strXML.IndexOf("\n", n+1);
string Char = strXML.Substring(Pos, 1);
thanks in advance
Vikas da
vikas da
|
|
|
|
|
all depends which string class you're using. basic C-style strings (char*), CString, std::string, BSTR ...??
|
|
|
|
|
Thanks for reply ..
I am using BSTR type
vikas da
|
|
|
|
|
I would like to know if there is any way to quit programatically the usual "cling" when a MessageBox or an AfxMessageBox is shown.
I have taken a look to the classes in the help but I found nothing and I don't want to go to the computer sound settings, I want to do it just in my app.
Can someone give me some info?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Take a look in the registry...
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default
These are the default sounds.
Notice that other apps can substitute their own set of sounds for
system events by adding subkeys under
HKEY_CURRENT_USER\AppEvents\Schemes\Apps
Note I haven't messed with this but maybe it will help point you toward a solution
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
But oign into the registry, will be the same as doing it through the explorer... And I would like not to deactivate the sounds for the operating system. Just when im executing my app. Because when Im testing things (the error messages that the user will have when something goes wrong) the sounds nerve me. I check ALL the errors that the user can have. So... that's the reason for just a piece of code inside my app.
Anyways, thanks.
I can disable them by starting app, and enable them another time by going out the app.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: But oign into the registry, will be the same as doing it through the explorer...
Not really - you can programmatically alter the registry.
Regardless, I tried messing with this, and while my registry entries cause the sound settings
for my app to appear nicely in the "Sounds" control panel applet, the system (XP SP2) does
NOT use my settings when running the application
Please let me know if you find a solution - I will do the same
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You could always create your own message box class without too much trouble.
---
Yours Truly, The One and Only!
devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
HI,
Iam involved in internationalization of my product.
Iam loading japanese resource dll for that.
I have an excel file which containg japanese strings.
while i copy the string from excel file to string table, it is not taking japanese strings ( just pasting ???????? ).
please help me about this.
|
|
|
|
|
Try setting your PC locale to japanese and then do the pasting work
Control Panel -> Regional and Language Option -> Advanced
|
|
|
|
|
iam using windows 2000 server.
i selected japanese in Regional settings.
if i type anything in string table properties entry, then it is in japanese but anything copying from my japanese excel still showing junk only.
|
|
|
|