|
kuphryn wrote:
What is the best solution to knowing when a server or client has sent the final piece of data across a socket?
You need to build it into the protocol the two apps are using to communicate e.g. the first 4 bytes sent are not data but the #bytes to follow.
kuphryn wrote:
Is it true that web servers sends the final piece of data with something ike this at the end?
Again, it depends on the particular protocol being used. For HTTP, I just wait until the server closes the connection which gives me an error when I call WSARecv(). A bit hacky but since HTTP is stateless, I can't think of a reason why the server would ever want to keep the connection open and so this should be OK.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
|
I want to open a document of myself format in IE.
This mode just like open an PDF file from internet in IE. The menu toolbar of PDF should combine with IE's toolbar and menu.
I know this is ActiveDocument.
But I don't know which keys in registry should I set when I want IE be a container.
Could anyone tell me how can I do this. A demo is better.
thank you.
|
|
|
|
|
|
Hi.
I've created a dialog with a CPropertySheet on it and a few CPropertyPages, this is not a wizard. For each of these pages, I would like to have a default button. Setting that attribute doesn't appear to work. I tried overriding OnOK of the dialog, checking the active page, and then calling the default button, but the message isn't sent when I press return. Any suggestions on what I should try?
I've searched here and several other places but couldn't find an answer, I'm sorry if I've overlooked it.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Have problem to save a bool to file and lod it again.
here is the Read function.
bool cHandleFile::Read()<br />
{<br />
<br />
ifstream Fil;<br />
Fil.open(cFilNamn,ios::binary);<br />
if (!(Fil)) {<br />
Beep(80,100);<br />
return(false);<br />
}<br />
<br />
Fil.read((char*)&g_bSound,sizeof(bool));<br />
<br />
Fil.close();<br />
<br />
return(true);<br />
<br />
<br />
}
FilNamn = FileName in english
Fil = File in english
Thanks for help.
---
Zuu is my name
|
|
|
|
|
|
how to open the ¤%&¤) file and write data to it. that could be read.
is there any built in class for that?
--
Zuu is My name
|
|
|
|
|
Just replace Read() with Write() and use ofstream
|
|
|
|
|
sizeof(bool) ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Didn't really know where else to put this so....does anyone know where I could find information or a tutorial on setting up CVS in Windows?
- monrobot13
|
|
|
|
|
WinCVS was pretty straightforward. A bit confusing at the beginning, and the documentation could be thicker... but after a few minutes, it was up and running.
If anyone knows how to integrate CVS with MSDEV... please let me know.
|
|
|
|
|
|
|
Is there any way to programmatically close an opened pop-up menu that was invoked with an API like TrackPopupMenu?
comrade
|
|
|
|
|
According to the MSDN, you can send a WM_CANCELMODE message to the owner of the popup menu.
Software Zen: delete this;
|
|
|
|
|
How can i change the cursor position in a text box ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I assume you mean the caret, not the cursor, and you want to do so programmatically.
If so, the best way to do so is to sublcass the edit box which allows you to control the positioning of the caret. However, you should be aware that this is not a trivial undertaking as you need to be knowledgeable of text sizing issues. The caret itself can also be problamatic to deal with.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Actually, I need to correct myself.
I checked and the CEdit api does have a PosFromChar method
So you could do something like this...
myedit.SetCaretPos( myedit.PosFromChar( index ));
That was not there the last time I had to do the same thing.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
You can do it using the SetCaretPos() method.
Regards,
Brian Dela
"There should be an amendment to the constitution, that every president must be examined for paranoia before moving into office." - peterchen
|
|
|
|
|
void CEdit::SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE);
void CEdit::SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE);
To set the cursor at the end of the text within the control...
UpdateData();
m_EditControl.SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());
UpdateData();
((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());
If you want to use the first function you have to set the starting position in the low-order word and and the ending position in the high-order word...thus
UpdateData();
DWORD dwSelection = m_EditContent.GetLength();
dwSelection |= m_EditContent.GetLength() << 16;
m_EditControl.SetSel(dwSelection);
UpdateData();
DWORD dwSelection = m_EditContent.GetLength();
dwSelection |= m_EditContent.GetLength() << 16;
((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(dwSelection);
Ciao, Andreas
"Software is like sex, it's better when it's free." - Linus Torvalds
|
|
|
|
|
Can somebody please tell whats wrong with my codes:
LPSTARTUPINFOW si;
ZeroMemory(&si, sizeof(LPSTARTUPINFOW));
si->cb= sizeof(LPSTARTUPINFOW);
si->dwFlags = STARTF_USESHOWWINDOW ;
si->wShowWindow = SW_SHOW;
PROCESS_INFORMATION pi;
CreateProcessWithLogonW(L"Arash",L"Mazy",L"aaa",NULL,(LPCWSTR)m_pathstring.GetBuffer(),NULL,CREATE_NEW_CONSOLE,NULL,NULL,si,&pi);
Access violation happend for this line:
si->cb= sizeof(LPSTARTUPINFOW);
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
LPSTARTUPINFOW is a pointer to a STARTUPINFOW;
You must creaet a STARTUPINFOW object not a LPSTARTUPINFOW object.
STARTUPINFOW si;
LPSTARTUPINFOW lpsi = &si;
ZeroMemory(lpsi, sizeof(STARTUPINFOW));
.
.
.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Hi, am the author of a movie collection organizer and I have noticed that there are other ones like it that have the capability to extract movie information from the IMDb and add it to dialog boxes in their program. I would like to add this functionality to mine as well but I have no idea where to start from. Does the data access depend on the layout of the site and how they store their data or there are different ways to do the same thing. If anyone is familiar with this site and some tricks on how to extract data from it please help me out on this. Thanks in advance.
|
|
|
|
|
first, contact a lawyer. what you're describing will likely be fair game for a copyright lawsuit.
-c
Please stand by
|
|
|
|