|
If you want to achieve high transfer rates you should consider setting you buffer sizes to at least 32K (e.g. read 32K chunks from a file and use a socket send buffer of 32K). Otherwise bulk data transfer will be very likely slower than 100 kB/sec.
Tip: Set the server socket send buffer to the wanted size (SO_SNDBUF and possible also SO_REUSEADDR ) after you created it, sockets created from the listening socket will then inherit this settings.
For further reading see Jon Snader's Effective TCP/IP Programming.
/M
|
|
|
|
|
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Use CWnd::InvalidateRect .
|
|
|
|
|
Or just CWnd::Invalidate() .
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: just CWnd::Invalidate().
Both function have similar effect, i.e. both function internally calls win32 funtion InvalidateRect , in case of
CWnd::Invalidate , it is
void CWnd::Invalidate(BOOL bErase)
{ ::InvalidateRect(m_hWnd, NULL, bErase);
}
In case of CWnd::InvalidateRect it is defined as
void CWnd::InvalidateRect(LPCRECT lpRect, BOOL bErase)
{ ::InvalidateRect(m_hWnd, lpRect, bErase);
|
|
|
|
|
prasad_som wrote: Both function have similar effect
That was exactly my point.
/ravi
|
|
|
|
|
Hi everyone i have a small problem.
In my app i need to save some txt, so i'm using this code:CFileDialog fileDlg (FALSE, "txt",strFilename ,OFN_OVERWRITEPROMPT| OFN_HIDEREADONLY, szFilters, this);
where for example m_strFilename="ADMA_log[01.01.2007]", and szFilters[]= "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";
Now i call DoModal() but i get nothing, my fileDlg m_hWnd = NULL.
I'f i change strFilename to "NULL" i get the windov but without initial filename that appears in the filename edit box!?
Help, please.
p.s.sorry for my poor english.
|
|
|
|
|
What is the value of _WIN32_WINNT ? If it's 0x0500 or greater, you'll need to use GetSaveFileName() instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I tryed doing so
<br />
char szFilters[]= "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";<br />
<br />
CString m_SavePath = _T("");<br />
char IniDir[256];<br />
char szFile[256];<br />
char buff[256];<br />
strcpy(IniDir, fs2.GetFolder());
strcpy(buff,"");<br />
strcpy(szFile,buff);<br />
<br />
OPENFILENAME lpofn;<br />
lpofn.lStructSize = sizeof(OPENFILENAME);<br />
lpofn.hwndOwner = m_hWnd;<br />
lpofn.lpstrFile = szFile;<br />
lpofn.nMaxFile = sizeof(szFile);<br />
lpofn.lpstrFilter = szFilters;<br />
lpofn.nFilterIndex = 1;<br />
lpofn.lpstrDefExt = "txt";<br />
lpofn.lpstrCustomFilter = NULL;<br />
lpofn.lpstrFileTitle = NULL<br />
lpofn.nMaxFile = 0;<br />
lpofn.lpstrInitialDir = IniDir;<br />
lpofn.Flags = OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY;<br />
lpofn.lpstrTitle = "Save";<br />
<br />
if(GetSaveFileName(&lpofn))<br />
{<br />
pMainFrm->Refresh();<br />
strcpy(IniDir, szFile);<br />
IniDir[lpofn.nFileOffset]=0;<br />
m_SavePath=szFile;<br />
<br />
CFile cFile(m_SavePath, CFile::modeCreate|CFile::modeWrite);<br />
EDITSTREAM es;<br />
<br />
es.dwCookie = (DWORD) &cFile;<br />
es.pfnCallback = (EDITSTREAMCALLBACK) MyStreamOutCallback;<br />
<br />
m_Output.StreamOut(SF_TEXT,es);
}<br />
and still not working!
Did I get all lpofn parametar's right, or what?
Big thanks!!!!
|
|
|
|
|
josip cagalj wrote: lpofn.nMaxFile = 0;
Why is this set to 0?
josip cagalj wrote: and still not working!
Which means what?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The parametar lpofn.nMaxFile was initionali set to lpofn.nMaxFile = sizeof(szFile);. i make a mistake copying code and i dont know how did i deleted it.
With "and still not working!" i ment thad openfile dlg still dont shows it self!
The 'GetSafeFileName(&lpofn)' does not open dialog!
|
|
|
|
|
|
|
Did you check _WIN32_WINNT and also your code working on the vs2005
|
|
|
|
|
http://www.codeproject.com/dialog/searchfolders.asp[^]
When it comes to the bit where you add member variables of this new static text type, how do you get that to appear in class wizard, so that you select the static control, click member variable, set that to control and then your option is to set it "CStatic". Is there something I'm supposed to do to make CStaticFileSPec appear, or do you just set it to CStatic and the "subclassing" lines in OnInitDialog take care of that?
|
|
|
|
|
Hi,
sorry to follow this up, but can someone point me in the right direction with this. The class here would really help me by displaying some long filenames in a dialog app I have, but am unsure whether the instruction to add a member variable means something via the class wizard, or if I can just manually insert this into the class via the code (and making sure I have everything in the right place)
|
|
|
|
|
OK, I just added it into the dialog class directly and it worked fine. Sorry for being a muppet.
|
|
|
|
|
How to get a text on the label control ? I have used the label control of the XGraph, It display a blank label. I need some text should be inserted and then properties are applied further.
thanx in advance
rams
|
|
|
|
|
Can you use of GetWindowText
|
|
|
|
|
If the label control is like a "real" Windows control, and you can get it's HWND , you may be able to use something like GetWindowText(...) . If it is a custom control, or is completely managed by your XGraph class/library, you may have to go through that class/library to get the text for the label.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi,
I have a Dialogbox (Main Dialog). I need to have another dialogbox (no title bar) inside this main dialogbox.
How can i do this ?
Thanks.
|
|
|
|
|
Insert a dialog to your resource or insert a new CDialog to your class
|
|
|
|
|
I mean to say that the second dialog should appear like other controls in that main dialogbox.
How ?
|
|
|
|
|
Sakthiu wrote: I mean to say that the second dialog should appear like other controls in that main dialogbox.
How ?
After insert it to your project use of Create
|
|
|
|
|
I have done this previously using two different approaches. The first was to simply reuse the Property Page/Property Sheet approach, the other was to manually manage the child dialog as a non-modal dialog window, and keep moving/sizing it as the parent is moved/sized.
You have to watch out for focus issues via keyboard navigation in either case. Look up the WS_EX_CONTROLPARENT style and KB articles that mention it for more information.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|