|
Hi,
When I press delete key, I want to delete the selected node from the tree control in the sdi application. Do I need to use keyboard accelarator? How do I do it? any example?
Also, I want to popup a dialog which says Do you want to delete the selected node with yes and no option. Is there any custom way to achieve this?
Please Help!
Thanks in advance
|
|
|
|
|
|
Hi
Thanks for your reply. Can you explain a little more detail please.
1. Where do I handle The TVN_KEYDOWN notification. I have a formview and added the tree controls in that view.
2. MessageBox has following syntax from msdn, where is the option to add yes and no button?
MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK );
please help
|
|
|
|
|
Many times (just to keep my sanity) I'd scrap an entire project, create a new one and add back in ALL the files that were in the previous project and start afresh. That's because doing a compile in VC++ 6.0 after I may have made some changes to a file and renamed it, then delete the old file and add in the new one, VC++ or AppWizard (I don't know which is responsible) would start producing compile errors about being unable to open the new file (even though the file would be physically present in the same directory along with the other files.
I'm getting a little tired of having to recreate new project files everytime (and then go through the same routine) every time AppWizard detects a change to the workspace.
What's happening now is that I copied a file from another directory into the folder that contains the project I'm currently working on. Then from Project->Add to Project->Files, I added the new file I just copied, then recompiled everything with a "Rebuild All".
Guess what!!
In the ".cpp" file in which the "#include" statement for the new ".h" file is being used, AppWizard is telling me that it cannot open the new file (even though it's physically in the same folder, and has already been added to the project)!!
AAAAGGGGHHH. Curses. Curses.
I can understand why some people shoot their computer!!
I ought to be able to add files, change files (etc.) without AppWizard acting up every time I do something like that.
Yes, I've also deleted the ".ncb" files (etc.) also.
Any workable solution would be unspeakably and indescribably appreciated.
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
This has nothing to do with AppWizard. AppWizard is simply a template based code generator. Once a project is generated, AppWizard plays no further part in the project.
Are you using quotes around the file to include, not braces? The presence of a header in the project has no bearing on the C++ search rules the compiler will follow.
I've replaced and renamed files in projects many times; just renamed a slew of files yesterday, and have never had a problem not of my own making.
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
In one way you're correct that once AppWizard creates the application, its job is over (no argument there). The effects of what the application undergoes afterwards because of what AppWizard did at its creation, is what has lasting ramification on the program performances throughout the rest of its developmental process, which is where I am and what I'm experiencing.
Yes, I am very aware of the difference between using double quotes on filenames forming part of the "#include" statement, and those that use angle brackets. (Files obtained from libraries use the angle brackets and files NOT members of those libraries, use the double quotes.) I also know how files must be accessed depending on their physically location in the various directories (and along the directory path), and the same on information about libraries with regards to their locations and how they can be accessed.
It's what AppWizard puts in the ".dsp" file at creation that have me believing certain names originally used, must remained unalterable throughout the duration of the project. I have been burnt too many times on that point to believe AppWizard allows freedom in name changing, because if that were the case, ALL those times when I've had to recreate a ".dsp" file and then add back ALL the other files into the newly created project file, that would NOT have been necessary if freedom in name changing was totally allowed.
Thanks anyway for your input.
William
Fortes in fide et opere!
|
|
|
|
|
WREY wrote:
The effects of what the application undergoes afterwards because of what AppWizard did at its creation, is what has lasting ramification on the program performances throughout the rest of its developmental process, which is where I am and what I'm experiencing.
That's still incorrect. AppWizard simply creates a series of files, nothing more. Any ramifications are due to the MFC architecture and Visual Studio itself.
The files in the DSP file aren't much more than a list of files and any options associated with those files. It is entirely agnostic as to the name of files. Some of those files may have specific compiler options for them which will be lost if you delete a file from a project then add it again, but that's about it. (Precompiled headers is the big gotcha.)
WREY wrote:
(Files obtained from libraries use the angle brackets and files NOT members of those libraries, use the double quotes.)
This isn't entirely correct. If you quote the file to be included, the compiler will look first in the same directory as the file being compiled, then along the include paths in order. If you enclose the file to be included in braces, it only searches the include paths.
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
This is a modal dlg spawned by another dlg. In its OnInitDialog I did a MoveWindow. The positioning is okay, but the dlg is rather large. Also the controls are not the way they look in the designer, where everything is centered. When I do Layout->Test its fine! But when it runs theres a big empty expanse with all my controls arranged on one side (like I arranged them in the designer). Its just that the dialog itself is too big, and the balnk space is to the right of my controls.
int width = GetSystemMetrics (SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);
MoveWindow( width/2 - 200, height/2 -150, 300,200);
What do I do about this?
Thanks,
ns
|
|
|
|
|
ns wrote:
and the balnk space is to the right of my controls.
That makes sense. Increasing the size of the dialog won't move the controls. You need to do this yourself.
[edit]
Also, may I ask why you're increasing the size of the dialog if the control already fit? If it's a cosmetic issue, you should create a modeless dialog containing your controls (and all their handlers), then make the modeless dialog a child of the modal dialog. After resizing your modal dialog, simply center the child modeless dialog by doing:
MoveWindow (...);
m_modelessDlg.CenterWindow (this);
[/edit]
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I wasnt clear. I mean that the dialog comes up weird even though at design time it looks perfect.
If I change the width of the window in the moveWindow:
int width = GetSystemMetrics (SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);
MoveWindow( width/2 - 200, height/2 -150, 100,400);
from 100 to 200 or whatever, the dialog is always the same large size with the controls clustered to the left. In addition to my design view I am getting a bunch of blank real estate to the right.
|
|
|
|
|
ns wrote:
I mean that the dialog comes up weird even though at design time it looks perfect.
Yes, that makes sense. By calling MoveWindow() you're increasing the dialog's width and height, thereby adding a bunch of white space to the dialog's right and bottom.
If you want the dialog's controls to be centered after you call MoveWindow() , you need to write an OnSize() handler that repositions each control by (delta_x/2 , delta_y/2 ). You'd need to add logic to compute the change in width and height (i.e. delta_x and delta_y ). There are quite a few dialog resizing layout classes at CP that will do this for you. I can also send you my own (unpublished) one if you like.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _DATA_TYPE
{
NONE_DATA,
JP_DATA,
DF_DATA,
DATA_RANGE
} DATA_TYPE;
#ifdef __cplusplus
}
#endif
|
|
|
|
|
Nothing syntactically. What do you think's wrong with it?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
...h(81) : error C2011: '_DATA_TYPE' : 'enum' type redefinition
|
|
|
|
|
Which means there's already a _DATA_TYPE defined someplace else. Put the cursor on it and press F12 should take you to the other definition.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Anybody have any ideas to help me resolve this problem?
Thanks for any help
|
|
|
|
|
Hi, thank you everybody for helping me do everything I posted a few weeks back. I took your advice and am doing great in my programming class. I'm getting a 109%! But I have one more question. Is there any way to add sound (such as speaking) to text? Example: You do printf("My name is Bob");
then you do something after it to make the computer speak My name is Bob.
I have a program called write out loud and it does that and i want to know if there is a way to do something like that in C or C++. I already know how to do sound(#); and nosound(); I just want to know how to have a robot voice say text you type in. Please post a small example.
Thank you!
Sincerely, Colin M.
|
|
|
|
|
SAPI, man, SAPI! SAPI rocks the big one! Get it here[^]
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
colin21 wrote:
I'm getting a 109%!
That's called STACK OVERFLOW. In your case I think it is a good thing.
Good luck with your class.
Chris Meech
If you spin a Chinese person around, do they become dis-oriented?
Why do people in this time period worry so much about time traveler's destroying their worldline when they have no problem doing it themselves every day? John Titor.
|
|
|
|
|
Take the Chinese joke out. Not everyone will think of it as humor.
William
Fortes in fide et opere!
|
|
|
|
|
Are you suggesting some people are too dense to recognize a simple pun?
Or are you on a political correctness kick?
Just curious........
|
|
|
|
|
You can rationalize it however way you want to make it look innocent. What is one man's pun is another man's pain.
I try to live by the simple rule of doing unto others as I would have them do unto me. Since none of us is perfect, tell us about your imperfections so we can make pun of them.
William
Fortes in fide et opere!
|
|
|
|
|
WREY wrote:
tell us about your imperfections
I guess I don't consider a person's being asian an imperfection like you do........
As for my imperfections:
1) I am 6'1" - taller than average
2) My hairline is receding
3) I don't fall on my knees weeping if I hear a simple pun
4) I indent like this:
int foo(int bar)
{
return bar/2;
}
instead of like this:
int foo(int bar){
return bar/2;
}
5) I have yet to break 100 in golf
6) I have a 1" scar on near my left ear
(I could go on for hours, why are you interested in this? It seems rather strange........
|
|
|
|
|
The person's Asian heritage is and has never been a consideration of imperfection to me.
I was specifically refering to your imperfections. YOUR IMPERFECTIONS!!!
That you readily equated heritage to imperfection, already shows density on your part to grasping the point and your penchant to bigotry to think it nothing when someone makes a joke about someone else's heritage, to simply refer to it as a pun.
No, I don't expect you to fall on your knees to weep for anything (and that includes your receding hairline and the fact that you may NEVER break 100 in golf).
Talk about receding hairline, it's obvious not only is your hairline that's receding, common sense and average intelligence are too. But why are so hypocritical about classifying flaws as imperfections. These are NOT imperfections. These are mere flaws that you're trying to pass off as imperfections. Give us the REAL IMPERFECTIONS.
William
Fortes in fide et opere!
|
|
|
|
|
A pun was made based on the similarities between the word "oriental" denoting asian heritage, and the word "orientation" meaning position or direction.
You slipped on your PC-Policeman's hat and made a comment.:
I replied that it was just a pun.
You said:
"You can rationalize it however way you want to make it look innocent. What is one man's pun is another man's pain."
implying that Chinese people are too (insert whatever word you see fit here) to understand that making a pun based on similarities between orient(the geographic region) and orient (to position) is not an insult.
You then said:
"Since none of us is perfect, tell us about your imperfections so we can make pun of them."
Now, if you want to hide behind the fig leaf of pretending to be too ignorant to understand context, then I guess your huffy rebuttal makes sense.
Here is the context:
A pun was made - a play on the 2 meanings of "orient".
You said this was wrong and had the potential to cause emotional scarring and that since I, too, was imperfect I should throw some of my imperfections up so you could try to emotionally scar me with clever punnery.
Now, since you offered my imperfection as a counter to the original pun, any person with a language parser that operates on a level above a chimpanzee's would assume the 2 statements were contextually linked.
Therefore, it can be assumed that you feel being Asian is an imperfection.
I notice that you went out of your way to convolute the actual meaning of your words. And with 20/20 hindsight and a mastery of your keyboard you managed to cobble together some semblance of a coherent revision.
Wouldn't have been simpler (and more truthful) to admit you misspoke and went a little PC-overboard?
WREY wrote:
Talk about receding hairline, it's obvious not only is your hairline that's receding, common sense and average intelligence are too
What baseline are you using to conclude that my "average intelligence" is receding?
WREY wrote:
That you readily equated heritage to imperfection, already shows density on your part to grasping the point
I was merely assuming that you had an at least pre-school level of understanding of context.
If I say to you: You are a man!
And you shriek back: That ain't cool! You aren't perfect either!
One can reasonably assume that you took my calling you a "man" as an insult.
WREY wrote:
and your penchant to bigotry
My wife is a Japanese-American. She thought the sig was funny.
WREY wrote:
when someone makes a joke about someone else's heritage, to simply refer to it as a pun
Look, I'll let you off the hook if (as I am beginning to suspect) you say English isn't your primary language. That sig did not make "a joke about someone else's heritage" it made a pun out of the 2 words (as puns are wont to do). The fact that one of the words is a racial description does not magically transform the pun into a racially demeaning joke.
WREY wrote:
These are NOT imperfections. These are mere flaws
Are you going out of your way to confuse me? Does your universe swim with perfect flaws?
WREY wrote:
Give us the REAL IMPERFECTIONS
I tend to find Politically Correct wannabe saviours of the world overly amusing.
|
|
|
|