|
|
Does this help?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thank u
i run another code and it run normaly.
only this code has " program too big to fit in memory "
|
|
|
|
|
lan sau post nho' them tag <pre></pre> truoc va sau dong code nhe, kho' nhin qua'
|
|
|
|
|
^^
em moi tap code thoi, anh thong cam...
|
|
|
|
|
what are these error ?
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
|
|
|
|
|
Are you sure that you've #includ ed <process.h> ? Also, why are you wanting to use _endthreadex ? Just return from the thread function. That's the best way to end a thread.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
i find a code and try to run it.
many errors that i don't know why !
|
|
|
|
|
Well, that's a good reason to start learning.
This signature was proudly tested on animals.
|
|
|
|
|
They are linker errors. See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Can anyone advise on this problem on Visual Studio 2005 MFC application?
When I add any new variables; e.g. say a structured array of some 256 elements my program crashes with an exception where the code was OK in all previous versions.
I am assuming that I have reached some limits on heap or stacks etc. and think that addresses/pointers are being overwritten.
Can some suggest and options to set to increase the programs resources.
Note the program reads in some large files and uses the CStringArray for lots o string processing.
Many thanks,
Graham.
grahamfff
|
|
|
|
|
What precisely was the exception? Any relevant code that you can show us?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I just tried to invoke the crash and the code section it occured in, but the problem has gone away. I did a work around when I encountered this crash and just wanted to try and sort it out now.
I just wondered if I used a #define items inside the structure I has defining.
Anyway should I worry about the data segment of the program as I am processing very large text files as already I needed to upgrade counters from short to int.
Regards,
Graham.
grahamfff
|
|
|
|
|
My guess is that by adding an extra entry then you changed the alignment of memory, and exposed an old bug where it accessed invalid memory.
Usually these bugs are hidden again by modifying the application again so the alignemtn of memory changes again.
|
|
|
|
|
Hello
When a TextBox is disabled the contents of that will all become greyish.
How to avoid that, and keep the contents in black even when
the TextBox is in disabled state?
Thanks in advance
|
|
|
|
|
You should really stick to the standards, otherwise your UI will be a hell to use. Maybe you don't want to disable the edit box but set it read-only[^] ?
|
|
|
|
|
Handle the WM_CTLCOLORSTATIC[^] message.
This message is sent when a read-only or disables text box needs to be painted.
The wParam parameter is the handle to the device context of the text box.
You can select a black pen into this device context using SelectObject[^] which will make the text black.
If you're using MFC override the OnCtlColor[^] function.
|
|
|
|
|
Superman,
Do you have any sample code that explains how to do this?
Thanks
|
|
|
|
|
Does Google not work in your neighborhood? He gave you the functions/messages to use, so how hard can it be to find samples of them?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Superman,
I am using an Edit Control.
I tried using the WM_CTLCOLORSTATIC message and added the,
SetBkCOlor and SetTextColor function.
But this is not working
Is it due to the fact that am using Edit Control?
I also tried using SelectObject and passed a BLACK brush, but that also doesn't seem to work
As soon as the Edit Control is disabled, the text in Edit Control becomes grayish.
|
|
|
|
|
You have to use SelectObject and pass in a BLACK pen, not a brush.
|
|
|
|
|
Inside WM_CTLCOLORSTATIC, i check whether lParam is equal to Edit Control handle, if thats TRUE
then i CreatePen by passing RGB(0, 0, 0), the resultant PEN is
then passed to SelectObject(HDC, PEN);
But this is not working. Any idea why it's not?
Do i need to "return" something for the WM_CTLCOLORSTATIC ?
Like, GetStockObject or something?
|
|
|
|
|
If your pen that you created is going out of scope when WM_CTLCOLORSTATIC returns then it will be destroyed and the control will be greyed. Watch your object lifetimes.
If this does not help, then post some code.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Instead of disabling the text box, just set it to read only (hine - ModifyStyle) - the text will stay black.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Problem with setting to read only, is that it will let the user select the text using
the mouse.
Where as in disabled mode, it will not let any mouse selections.
I tried using WM_CTLCOLORSTATIC but not able to make just the text BLACK
|
|
|
|