|
Does setting a carriage return '/r' in callback
streamin Richeditctrl cause the text to go
to a new line
|
|
|
|
|
I've no idea - but two suggestions…
1) Try it and see (try a '\n').
2) Enter some multi-line text into a rich-edit control and see what comes out when you use the EM_STREAMOUT message
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
I have a ES_AUTOSCROLL style maybe I
should take that out and try to size the editctrl
to some optimum size
|
|
|
|
|
Maybe something about the mouse hook...
When I click some file's icon ,then how to return its path?
Thanks!
|
|
|
|
|
I believe you should provide more details about what you want to do, till now it isn't obvious what you mean...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
I am doing a work like a monitor.
I mean when I click some file'icon on the desktop , for example ,system will return a messagebox says "this file's path is ...".
How can the system know what I have chosen?
I need system return the file's path.
|
|
|
|
|
I personally don't know any standard way to do what you want (which of course does not mean there isn't any).
You could try hooking into explorer.exe, subclass the list control that hosts the icons on the desktop, or the window that receives notifications from the list view, or installing a (system-wide?) message hook, to find out when and to what the selection changes. Then you could use SHGetDesktopFolder[^] and use IShellFolder::EnumObjects[^] to find the path for the selected item, if it has any. How you would find out which icon belongs to which shell objects is beyond me at this point, you could try finding that object by the name the icon shows but this is probably a bad idea (for example if i have a "myFile.pdf" and a "myFile.txt" sitting on my desktop, i think both will have the name "myFile", the extension is hidden, or at least can be). If you are lucky then the items' itemdata contains something that can be used to identify them, for example a pointer to a IDList or somesuch, then you could even skip the "look up" part thorough the enumeration. This whole thing is just an idea and not a simple one at that...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Oh, I am still a freshman and what you said is really hard for me..
Haha, still, thank you very much!
I will try..
|
|
|
|
|
If you are a freshman i recommend starting with something simpler, anyways, good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
yeah, Thank you!
Any problems can I ask you for help?
|
|
|
|
|
Sure.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hey everyone, new guy here.
I'm in a Game Physics class where we are learning OpenGL and a little bit of GLUT. In class, the pc's run Win XP and Visual C++ 2005 Express. I can get it to run my code in class with no problem. However, when I come home, for some reason I keep getting linker errors. I'm running Win7 Home Premium 64-bit. I've put the files into what I believe to be the correct folders, but whenever I compile and run, nothing. Anyone have any ideas? I'm starting to get really far behind in class because of this.
Thanks!
|
|
|
|
|
epinez wrote: I come home, for some reason I keep getting linker errors.
epinez wrote: I compile and run, nothing
These conditions are contradictory. If you're having linker errors, what are they?
If you have linker errors, you can't "run".
The wonderful thing about the Darwin Awards is that everyone wins, especially the members of the audience.
|
|
|
|
|
Sorry, should have been more clear. I attempt to compile and run, but nothing. The errors I get are: " error LNK2019: unresolved external symbol..."
Just to give insight to troubleshooting I've tried: I've put the GL and GLUT files in several different places and I've tried uninstalling VC++ and reinstalling it.
|
|
|
|
|
Is GLUT built for 64 bits on your home system or did you bring home the 32 bit libraries?
The wonderful thing about the Darwin Awards is that everyone wins, especially the members of the audience.
|
|
|
|
|
epinez wrote: The errors I get are: " error LNK2019: unresolved external symbol..."
Could you please give the exact error message. It helps to know which library is missing...
|
|
|
|
|
Well unless you tell us what errors linker is compaining about how can we help you?
-Saurabh
|
|
|
|
|
My professor decided it'd be a wonderful idea to have us code a binary search tree. I'm somewhere in my fourth or fifth attempt, and I'm about to break something I'm so frustrated.
So, where I'm at: I've currently got two classes, BST for the tree, and BSTN for the tree's nodes. I'm attempting to write an insert function, and I'm using the pseudo-code from Introduction to Algorithms (3rd ed) to guide me (is it okay to post that pseudo-code on a forum?). I just seem to keep not being able to get my code to work (and please forgive me if I'm a bit slow... I haven't done much with C++ in over a year).
BST.h
BSTN.h
I've opted for pastebin, so I could highlight the specific lines that I'm having trouble with (in BST.h). So, the three I have highlighted are where I've departed from the pseudo-code, and two of them are why I think I need to overload operator==. On line 39, the pseudo-code says to check that currNode is not NULL, but it never evaluates to false if I use the condition currNode != NULL . Line 48 I don't think should be commented out, but if I assign the parent there, if the node happens to be the root, it won't have the NULL parent that it should, so I don't get why they think it ought to be done there. And line 50 should have the condition currNode == NULL , but that will never evaluate to true.
Do I need to overload operator==? If so, how do I do it? I've tried several times and nothing has worked. Or are my slight modifications to the pseudo-code's method going to work fine?
And once this is sorted out, I probably have more questions.
Oh, and I'm using Visual C++ Express 2008.
|
|
|
|
|
Yes it is perfectly fine to post pseudo-code here.
At line 39, you want to check if currNode is not NULL then why are you checking currNode->element == NULL . element is not a pointer and checking if it is equal to NULL is equivalent to checking if it is equal to 0 (Note: NULL is defined as #define NULL 0 ). You should check currNode != NULL , then you don't need == operator.
There is similar problem in the BST constructor. You assign NULL to root->element.
Line 48: I haven't seen the psuedo-code so can't comment how faithful is your implementation. But I will implement it like this.
constructor:
root = NULL;
insert:
if(root == NULL)
create root and set its element to given value.
else
insert element in proper place.
Also it is a good idea to define a constructor for BSTN and initialize its member variables to default value there. Then you can simple do BSTN* node = new BSTN; .
-Saurabh
|
|
|
|
|
I'm feeling like you've missed my problem entirely. My problem is that currNode == NULL and currNode != NULL don't work, even if I don't overload operator== (and once that's overloaded, doing operator!= should be easy). I attempted to overload it so that I could get it to work, but I have been unsuccessful so far. So after overloading wasn't working for me, I tried testing a member variable within a node that will allow me to enter/skip the while loop or if statement, and that's how my code currently stands.
If it might help, here's the book's pseudo-code:
TREE-INSERT(T,z)
1: y = nil
2: x = T.root
3: while x != nil
4: y = x
5: if z.key < x.key
6: x = x.left
7: else x = x.right
8: z.p = y
9: if y == nil
10: T.root = z
11: elseif z.key < y.key
12: y.left = z
13: else y.right = z
(Introduction to Algorithms, 3rd edition, p 294)
|
|
|
|
|
I didn't missed anything at all. I can only see what you present me and your code doesn't check if currNode == NULL
Can you share the code for createNewNode() ? In the constructor you are doing root = createNewNode(); and then later in insert you are assigning it to currNode on line 37. Now if createNewNode is indeed creating a new node then how can currNode can be NULL?
That is exactly why I suggested that root must be initialized to NULL in the constructor.
-Saurabh
|
|
|
|
|
By the way in the psuedo-code x is assigned T.root but it is not mentioned what is the initial value of T.root. I guess the book must have mentioned it somewhere else that it should be initialized to NULL.
-Saurabh
|
|
|
|
|
The way I've been taught binary search trees is that, by definition, the root node is set to NULL when the tree is created.
I was misunderstanding the difference between setting a node to NULL, and setting each of the node's members to NULL. It's been a rough week.
And, yes, the book is indeed assuming that all nodes are initialized to NULL.
I've gotten rid of createNewNode() because it really wasn't doing much for me (I thought it was included earlier, but I guess not).
I was a bit snotty in my previous reply, and I apologize for that. What you've said has helped me think more carefully about what I'm actually doing with the code. (And I appear to have insertion completely working now!) Thank you for the help!
|
|
|
|
|
You are most welcmoe. No worries at all. Good luck with rest of assignment.
-Saurabh
|
|
|
|
|
Is it possible to add icons to a dialog window's title bar? I'd like to add some LED-style status indicators to a dialog-based MFC application which should be shown next to the close/maximize/minimize icons. I imagine it's to do with non-client area painting but I couldn't find sample code. I don't want to create the whole title bar - there are examples around for that - but just add an icon or a bitmap.
|
|
|
|