|
Yes, that's exactly what I want. I want basically a control on a dialog which looks and behaves like a list box which does not allow selections. So I figure the edit box is the best way to go about this. From the resource editor I chose multiline/vscroll/read-only. Displays the text file just fine except for when it starts up where everthing is highlighted. The only other problem is that if you start dragging the mouse all over the control then the text gets distorted...maybe I should process mouse messages? So basically that's it. The main problem them is the the text being selected. The HideCaret() function was very nice. Thanks for your help.
|
|
|
|
|
basic solution needs 1 second.
if u have more than 2 controls on dialog, extra one may be any except CStatic. goto resource edit, from menu tool(?) then select TAB order, change the edit control not as first. that is all.
but the edit is light-gray. for high level solution, u need to override the edit to handle message.
includeh10
|
|
|
|
|
That was a great idead, even though my dialog is filled up by just one huge edit control. But I made one more, put it behind the main one, made it invisible and gave it a TAB Stop of 1. Than I subclassed the edit control so as to not be able to accept WM_LBUTTONDOWN messages and that was all. Now the caret doesn't show and most importantly the text is NEVER highlighted. Maybe this isn't the best way to go about things but if it works...why not...thanks so much for your time.
|
|
|
|
|
hi,
the usage of CCriticalSection, several threads try lock(), unlock() the CCriticalSection object.
i want to know whether the lock(), unlock() action be atomic operation.
i think it is not a atomic operation, right?
if so, does anyone know the mechanism inside object able to prevent any interrupt to the object during one thread locking/unlocking the object?
thanks,
jim
|
|
|
|
|
If it wasn't atomic what would be the point of it? The purpose of CCriticalSection is for thread synchronization, so I would guess that it would be an atomic operation to lock/unlock the object.
I would guess that the mechanisms in order to make that happen are done at the opreating system level, but other than that I have no clue.
- Anatari
|
|
|
|
|
Was wondering whether it is possible to view normal function names in a .c file in the Workspace pane.
The function is not a class.
Codewright has this feature.
Thanks.
|
|
|
|
|
You have them, under the "Global" folder.
Back to real work : D-21.
|
|
|
|
|
I just opened the *.c file without loading any *.dsp or *.dsw.
Any pointers how to load the global folder?
Thanks.
|
|
|
|
|
I have a property sheet. Before I changed anything, the default push button used to be the OK button.
Then I added three pushbutton controls the the property page. Now the first button I added has become the default pushbutton. In the UI, "Default Pushbutton" is not checked, however, running Spy++ confirms that this button is indeed being set to be the default pushbutton.
Why is that? How does MFC select which button it will use as the default? How do I change it back so that the OK button is the default?
Jon Sagara
If you think of wheat fields as questionable metaphors, you can think of me as the state of Kansas.
-- Mike Blaszczak
|
|
|
|
|
Thats strange, because I had the exact opposite experience. I had to override several functions before I could get it to stop being the default button. You can try this tho:
In your CPropertyPage derived class override the OnInitDialog() function. Then include something like this in it:
<br />
BOOL CYourClass::OnInitDialog() {<br />
BOOL nRet = CPropertyPage::OnInitDialog();
SetDefID(IDOK);
return nRet;<br />
}<br />
I think it will work else where in your code too. Like in response to an update UI message would be a good place i think.
- Anatari
|
|
|
|
|
Would anyone tell me whether i can use CArray and CTypePtrList toghether? Are they conflicted to each other in Serialize function?
Thanks
|
|
|
|
|
What do you mean by using them together?
- Anatari
|
|
|
|
|
|
Do you know of any free tool which I can use to view my memory while I play with it...???
VC++ 6.0 memory window isn't cutting it...
I'm trying to watch char's get added and deleted and the memory view pane in byte hex mode just isn't working.
0064FDE0 48 65 6C 6C 6F 20 57 6F Hello Wo
0064FDE8 72 6C 64 0D 54 68 69 73 rld.This
0064FDF0 20 73 75 78 0D 4E 75 74 sux.Nut
0064FDF8 74 69 6E 20 72 75 6C 65 tin rule
0064FE00 73 0D 00 00 00 00 00 00 s.......
The address column is really annoying...
Mainly i'd like to view strings with carrage returns while mucking around with the memory...?
Ideas...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Have you tried setting a 'watch'?
Software Zen: delete this;
|
|
|
|
|
Hello,
I am using VC++ 7.0 and I am having some trouble. I am trying to build a solution with multiple projects. All but one of the projects is set to produce a .lib (Configuration Type) as opposed to an .exe or .dll etc.
Some of the projects depend on and use functions from others.
The problem I am having is this:
Visual Studio seems to be automatically inserting library files into the (presumably lib) command line arguments that I did not specify. In other words, when I open the project fresh, those libraries do not appear in the command line. But then when I build, they suddenly appear.
The result seems to be that I am inundated with many of the warning LNK4006.
Has anyone had this problem or know what I am doing incorrectly?
Thanks
John
|
|
|
|
|
I try to write the LF(#10) char to a file using putc() but it automatically add the CR(#13) before LF. Is there anyway write only the LF char? Thanks.
|
|
|
|
|
Try open the file in binary mode...
Just an idea.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I recently loaded Visual.net 7.0. I had been running an earlier version on another machine. I am now getting the following error message, the name of the program is CorpStrat.exe
'CorpStrat.exe': Loaded 'C:\CorpStratRes\CS2\Debug\CorpStrat.exe',
Symbols loaded.
'CorpStrat.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Cannot find or
open a required DBG file.
'CorpStrat.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Cannot find or
open a required DBG file.
The program '[1812] CorpStrat.exe: Native' has exited with code 1 (0x1).
I am at a loss here. Any suggestions?
Al
|
|
|
|
|
It only means that you don't have the Windows Debugging Symbols installed, and that's why it can't load the symbol files (.dbg) for the system dll's.
Don't worry, it's not an error.
You use the symbols when you watch your "call stack" window, then you can see the actuall function names, instead of just the offsets, in the windows dll's.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Is there a way to have "true" symbolic variable ?
I'm pretty sure that I'm not explaining myself correctly, the situation is that I
have some #define that represent the type/state of some object.
#define STATE_UNDEFINED 0
#define STATE_SOMESTATE 1
#define STATE_SOMEOTHERSTATE 2
and I have a variable somewhere
int someState = GetState();
if ( someState )
{
}
The question, is there a way to make the state thingy really symbolic ?, not an int, char, or something else ? that I have to explicitly set and/or equal to the whole symbol ?
I'd like to prevent the user to think and abuse the fact that it's an int !
Max.
|
|
|
|
|
I believe that's one of the problems enumerated values solve:
enum State { Undefined, SomeState, SomeOtherState };
State state = GetState();
Is this what you're talking about?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
|
|
|
|
|
It's better, but I can still abuse the fact that enums are int.
State myState = 0;
Not in C++ but in C it's working ! since I'm working with a mix of C and C++
Max.
|
|
|
|
|
Well, enums are the closest thing you'll ever get to symbolic manipulation in C++ I'm afraid.
If you want symbolic manipulation, please see the Lisp-family. It was designed for it, and it excels at it.
--
standing so tall, the ground behind
no trespassers, on every floor
a garden swing, and another door
she makes it clear, that everything is hers
A place of abode, not far from here, Ms. Van de Veer
|
|
|
|
|
Hi everyone,
I'm new to C++ programming and i'm still learning, i was just wondering if its possible to execute a dos comman in C++? like the command FINDSTR, why i want to use this? because no doubt about it its fast when it comes to searching for a particular text in a file, and since my project is about searching i thought this is a good idea. Please if you know how kindly help me.
Thanks/Regards
Sidney
Thanks/Regards
Sidney
|
|
|
|