|
|
Wow fancy!
Thanks man, this is exactly what i need!
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
I have a tcp connection to a server that works with text commands and uses '\n' as the delimiter. Unfortunately, the packets get torn into pieces or they get stuck together quite often (as in any tcp connection) so i can't just parse one packet at a time. I'd like to know how i can handle it so i can keep receiving data untill i hit the delimiter and store that into a string, parse it and continue receiving the rest of the packet and perhaps some data of the next packet untill another delimiter shows up. If anyone knows a tutorial about this or knows how to do this, please help.
(I'm using asynchronous mode)
Thanks.
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
This same problem got posted yesterday or two days ago. You have two options:- When a new line is to be read, keep reading while
'\n' is not found and stuffing all the input to a temporary buffer (in your case an std::string would fit nice). When the end of line is found, return the complete line and keep the last part of what you read (i.e. the part after '\n' ) in that temporary buffer for the next read operation. A little convoluted, but not hard to program.
- For each line written, send before a variable (say an
unsigned long ) specifying how many bytes the line has. Upon reading, you just have to read the size information first to make then an additional read operation for the exact amount of data needed. This requires that you are in control of the sending part, and poses some crossplatform compatibility problems (that can be fixed, nevertheless).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have imported a project developed in VC++ 6.0.
and am getting this(these) errors when running
C:\\windows\system32\ntdll.dll , cannot find or open a required DBG file
C:\\windows\system32\mfc70.dll , cannot find or open a required DBG file
How do I fix these?
Thanks -JoeSox
|
|
|
|
|
mfc70.dll is the MFC version from Visual Studio .NET (not 6.0), I think. Oops, I misread your question, sorry.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How do you put that line Joaquin?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
enclose the paragraph you want to overline just like this:
<p style="text-decoration:line-through">This shouldn't have been written</p>
This shouldn't have been written
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks
Ooops,thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
HTML tags for every occasion Didn't know about that one.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hEY, What about my question?
No one has ever encountered this problem?
The Release Build still compiles but these show up in the output window.
|
|
|
|
|
Oh,sorry Joe ,it's better to put new message
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
let me test it
Thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I need to display text in an edit box. Now, I need to use a function other than SetWindowText because it doesn't allow me to display an array. Any suggestions?
|
|
|
|
|
What do you mean it does not allow you to display an array, an array of characters, or an array of strings?
Are you dereferncing your string in the array of strings that you want to display?
|
|
|
|
|
One method is to associate a CString (say, m_myText) with your CEdit box, update the varialbe (m_myText) and call UpdateData(FALSE).
|
|
|
|
|
Why would another function exist to do the same thing, but differently ? If you hav an array and you want to show all of it in the title, you'll need to build a string that contains the array elements as you want them.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
Hi,
I'm wondering how coudl I insert a "File Edit View.." standard Menu on thetop of CMyDialog class.
I found information about inserting a ToolBar and I added it succesfully (with RepositionBars(), at least!), but nothing about the menù
Any help will be appreciated!
Bye.
|
|
|
|
|
You can add a menu resource to a dialog using the resource editor. Nothing special is required in order to do this.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
1. create your menu resource in the menu editor.
2. Call:
<br />
HMENU hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(ID_MENU));<br />
Where ID_MENU is your menu resource handle and hInstance is the instance to your current application. You could also use
<br />
::GetModuleHandle(NULL)
this will load your menu resource and assign it to an HMENU.
3. Call the SetMenu member function of your CDialog class in order to assign this menu with your dialog window.
If you want to change the menu out later or get rid of this menu call SetMenu with a new menu handle or NULL, respectively.
When your app is done, free the menu resources with DestroyMenu(hMenu);
You can also associate a menu with a dialog if you have created a special class that subclasses the dialog class by setting the MENU field in the CLASSINFO structure before you register your class.
If you would like more details on this method feel free to ask.
|
|
|
|
|
Just go to dialog editor,in property page of dialog,there is
combo box to set your menu.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I like both the static and the dynamic solutions.
(I love this board, too)
|
|
|
|
|
Hi
I'm fairly new to MFC programming and am busy building my first "serious" application for my own use. It is an online diary - I've put together an MDI application (so that I can set the background colors etc.) derived from CRichEditCtrl. I've managed to work my way through allowing the user (me!) to change font, font size, bold etc. etc.
I am a bit stuck now, though. What I'd like to do is remove the necessity to manually save each day's document. I would like to put the following in place: each time I start the app, it checks the date, and then checks to see if a document exists for this date. If so, it automatically opens the appropriate document so that I can add to it. If not, it opens a new document which will then be automatically saved at the end of the "session".
As far as I can work out, I need to find a way of automatically saving the document with "today's" date whenever a session is ended. I have found out how to automatically save an existing doc when exiting the app, and reload it when restarting the app. BUT... I don't know how to specifically save a new document using a filename that I generate, rather than the user having to specify one.
Can anyone please help? As I mentioned earlier, I'm new to MFC programming, and I'm doing this program as a "learning exercise". So far, I have found this site to be amazingly full of useful info (thank you to all programmers who take the time to help others!!)... and I'm hoping that someone out there can help me with this (small) problem.
Thanks
Keith Goddard
Pietermaritzburg, South Africa
|
|
|
|
|
If you are using MFC's Document / View architecture, you could generate the name of the file that you want to give your new file, and set the file name of "today's" document with the SetPathName member function of the CDocument class.
Then with the code that you have already written to automatically save files with the names, this should work with out asking the user for a file name.
|
|
|
|