|
Have searched and searched the forum but cannot find the answer....I am using code found on CodeProject to append lines to an edit box in an MFC application I am playing with.(Hobby Programmer). I want to delete the second line of the text (entered programmatically by selchange of combo box)if the text is different from the existing. For the life of me I cannot figger this out. thanks in advance.
Michael (previously vb now c++) Judy
|
|
|
|
|
It has been a while since I have done any thing like this but if you look in the index of the MSDN library and find "edit controls [Win32]" you should be able to figure it out.
If I remember right, you need to select the text to be deleted (EM_SETSEL) and then send WM_CLEAR [delete/clear current selection] message to the control or EM_CUT [delete and copy current selection to the clipboard].
INTP
|
|
|
|
|
I'll give it a go. thanks for the reply.
michael judy
m_judy@hotmail.com
"According to my calculations there is no problem"
|
|
|
|
|
Any ideas how to convert: c:\something\s.ext -> file:// uri
Thanks
|
|
|
|
|
|
I'm implementing the osi model's all 7 layers as my final year(B.E.I.T.)project.and want to discuss about the designing & implementing it in VC++6.0 .Later thinking of updating the project for dot net platform.
please help!!
|
|
|
|
|
I thought of doing that once, it will be difficult. Do you know if anyone else has implemented this before?
|
|
|
|
|
hello.
I have an dialog based program, I have created the actual tabs but I cant seem to display the dialog, tried sei item, insertitem and even create (which cause the program to crush when it gets to the line). how can I do it using the CTabCtrl class?
if not is there an other easier way to do it?
|
|
|
|
|
Hi all...
I want to create a 2D game like "Mario Bros." (Super Mario).
But one thing sucks...
I m an absolute begginner.
I have 4 years experience in VCPP. (WIN32,MFC)
But I don't know any thing about drawing stuff (and related).
I need tips... Lots of tips...
as a starting point.
10x
=-=-=-=-=-
The Server
|
|
|
|
|
well if your a beginner as you say you are then you should study one of the following topics and maybe read a book of them : OpenGL or DirectX(You need the sdk for this, find it @ MSDN website).
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
It might help to look at an existing clone, I beleive there is one a sourcesforge.net.
There are also lots of sights devoted to game programing that provide: totorials, algorithms, and much more. For a first game I would recommend the book "Action Arcade Adventure Set" By Diana Gruber, if it is still in print. I do not have the www sight handy, do a search for "Fastgraph" on the net, and look for "Ted Gruber Software".
Have fun!
INTP
|
|
|
|
|
|
hi,
I have a client/server app using CSocket and CArchive. There are data transfer in both the directions.
It works well for sometime. Then the client is not getting OnReceive triggered. But using a network monitoring tool, I found that the server is sending the data properly.
How do I found the problem/Debug?
Thanks,
Praba
|
|
|
|
|
It will probably involve setting up the kernal debugger since it is most likely a driver function.
Be warned that it will consume consierable time. You have to wait for it to fail, then break into the program to "see" the conditions present at the time on the loss of communications. Next see if it is repeatable. It will be easier if the problem is repeatable, look through the data being transferred and fin the data that will be transferred just prior to the "bad" condition. set a breakpoint for that condition and single step through the next series untl you find the problem (its not a lot of fun).
It it isn't repeatable, you have to look for similarities in the conditions that exist at the occurrance of each "bad" condition. the identification of the similarity may lead you to a solution, but most likely you will have to devise some sort of break condition that fortells the "bad" condidition, allowing you to step through. this could literally take days.
What I have found is a "race" condition that exists between the time the data is reported as being reay for the receive buffer and the actual data being ready, so when you go to read the buffer you actually get one or two bytes less thean what was reported as being ready, leaving the reporting mechanism in some sort of unknow condition. It thinks it has reported the condition to you and you haven't responded and won't notify again until you have correctly responded to the prior message. It could be caused by some anomoly in the actual data or some mishap in the driver, but it is annoying.
|
|
|
|
|
Hi Dears
I want to develop a MS Word Addin. The main functionality of this addin is:
--> I have to convert MS Word file (.doc) into (.pdf) file format.
What should I take as first step to implement this functionality.
Kindly guide/help me in the form of some code/link.
I'll be grateful to you.
Kind Regards
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
I would start by getting familar with Microsoft's Interop capabilities, then I would goto http://www.wotsit.org/ and get the format of a ".PDF" file and finally, I would write the code. It would be a tedious process but not shouldn't take too long.
Microsoft's Interop cabilities allow various Microsoft technologies to cooperate together. Depending on your format, the capabilities may help.
However I believe the ".PDF" format is controlled by Adobe and you might need their permission for whatever you are trying.
|
|
|
|
|
Hi,
I'm just starting Visual C++, and in my book--Ivor Horton's Beginning Visual C++ 6--there is an initial section talking about how "data" is stored in a document, and the view displays all or part of the data in a document.
Then it goes into how to draw in a window with functions like LineTo() and Arc(), but what confuses me is those functions are in the OnDraw() function in the view class.
The first line of the OnDraw() function is this:
<br />
void CSketcherView::OnDraw(CDC* pDC)<br />
{ <br />
CSketcher* pDoc = GetDocument();<br />
which seems to make sense--my thought was we would be using pDoc to store the data in the document object and then display it with the view object, but the next lines are:
<br />
void CSketcherView::OnDraw(CDC* pDC)<br />
{ <br />
CSketcher* pDoc = GetDocument();<br />
<br />
pDC->MoveTo(50,50);<br />
pDC->LineTo(50,200);<br />
}
And, when I compile that, it draws a line in the application window. Well, as you can see pDoc was never used to access the document object, and yet the view class displayed data in the application window--I thought the view displays all or part of the data in a document. It seems to me the document got left out of the equation. What's the explanation for that?
|
|
|
|
|
7stud wrote:
CSketcher* pDoc = GetDocument();
I think that should be
CSketcherDoc* pDoc = GetDocument();
Unless you have gone to the trouble of renaming the class.
Check you have a CSketcherDoc class
Yes Doc/View is confusing.
1. Remember you never see the document with it but a view of it inside a frame.
2. You can change the View of the data but the data does not actually change.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
7stud wrote:
It seems to me the document got left out of the equation.
You're right - that's a terrible example and speaks volumes about the author and his/her editing crew. Also, as Colin pointed out, it should be CSketcherDoc* pDoc = GetDocument(); , not CSketcher* ... .
A better example would have obtained the coordinates used in the MoveTo() and LineTo() calls from the document. This would reinforce the notion that the document stores the data which is simply rendered by the view. A different view class might simply list the coordinates in a tabular form (perhaps in CListCtrl ) instead of drawing within the view.
Hope this helps.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
<quote>Also, as Colin pointed out, it should be CSketcherDoc* pDoc = GetDocument();, not CSketcher*
That was a result of my typo.
Thanks for the reply.
|
|
|
|
|
Simple, it is just a bad example. What I mean by that is it is incomplete. Your conclusions of how it works is correct. The information/data is stored in the document and is displayed in the view. What information and how it is displayed is up to the veiw that is displaying it.
One example would be a program that displays numaric data in various forms in different views (using the same data): a spread sheet showing the actual numeric data, a view showing a bar chart or some other type of chart of the same data. When the data is changed in the spread sheet the document is updated with the new data and a message is sent informing all views that the document has changed (been modified) and they need to update their views to reflect the change.
There are some interesting examples in the MSDN Library, if you can find them.
INTP
|
|
|
|
|
|
Hello,
Since you're a beginner whos learing, not everything gets pointed out in detail! I'm almost sure that when you read and learn more that the document will be used inside the OnDraw() and other functions!
(I'm missing 1 line in the code! the 2nd line should be:
ASSERT_VALID(pDoc); )
Good luck...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
The hooking appl is working in GUI mode, but it does not work when I changed it to console mode, that is I call the sethook function by loadlibrary in console exe instead of GUI exe
Has anyone got the reason?
Thanks.
|
|
|
|
|
which hooking app are u talking about?
Don't try it, just do it!
|
|
|
|