|
Are you using TCP ?
If yes, put the flag TCP_NODELAY.
It's a classic error issue, in fact many people are confused by TCP.
It's a simple example but with the TCP_NODELAY flag you should be able to receive your 5 bytes at once.
[^]
|
|
|
|
|
Your client side project is UNICODE. Either select MBCS in project settings, or
CStringA sendstr;<br />
sendstr="Hello";<br />
client.Connect ("127.0.0.1",2500);<br />
int len=sendstr.GetLength ();<br />
int sent= client.Send( LPCSTR(sendstr),len);
CString is macro, which translates to CStringA or CStringW. You can assign either Unicode or ANSI string, CStringW/CStringA will take care of that.
|
|
|
|
|
hai,
I want to get notified of any process (E.g. mstsc.exe ) at the time or its starting.
How can I do it.
Please provide some useful hints.
-Cvaji
|
|
|
|
|
Cvaji wrote: How can I do it.
Please provide some useful hints.
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello,
i try to open a file with CStdioFile but fails any time when i try!
I receive an error 11, and GetErrorMessage returns a "File Error > (11) "A Sharing Violation Occurred ...""
This is when i use VS2008, but the same function and same file with VS2005 works normal, without any errors!
CStdioFile pStdFileLocal;
if(!pStdFileLocal.Open(csFilePath, CFile::modeRead, &e))
{
}
Is there any change in VS2008 with files and file functions???
Thanks for any help!
Arrin
|
|
|
|
|
did you try modShareDeny??
modified on Friday, April 9, 2010 11:37 AM
|
|
|
|
|
Hi,
sorry is my mistake
i have already open that file before and did n close the file handle
thanks for answer
Arrin
|
|
|
|
|
All the processes reading the same file, must open in CFile::shareDenyNone mode.
|
|
|
|
|
Hi,
sorry is my mistake
i have already open that file before and did n close the file handle
thanks for answer
Arrin
|
|
|
|
|
|
You mean you can step through the entire code but running it doesn't work?
-Saurabh
|
|
|
|
|
i stepped through each line with less data points, am sure it has to do with the amount of data
am processing but i don't know else to go about memory allocation.....
|
|
|
|
|
Oh that might be the problem. Why not use same dataset in both cases?
Also when you let the program run and it show the error dialog if you click on retry then it will take you to the line at which crash occurs. If you look at the stack trace then you might be able to find the offending code line.
-Saurabh
|
|
|
|
|
i used the smaller set to make sure my algorithm was right. when the unhandled exception msg box appears, i click on OK and takes me
some kind of assembly code: 7C812AFB pop esi.......i really don't know how to debug this
|
|
|
|
|
In just a manner of minutes, you could have narrowed the problem down to just:
void main( void )
{
vector<_variant_t*> Filtered_Average(9995);
for(unsigned int k = 0; k < Filtered_Average.size(); ++k)
Filtered_Average[k] = new _variant_t();
for(k = 0; k < Filtered_Average.size(); ++k)
{
_variant_t *m = Filtered_Average[k];
delete [] m;
}
} Hint: two extra characters are causing you grief.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
At first look, I thought you had 'deleted' the hint.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
expression ?
do you mean exception ?
if you're getting an unhandled exception, the easiest way to find out what it is is to.. handle it.
try
{
... do something
}
catch (CException *e)
{
e->ReportError();
}
|
|
|
|
|
I have just realised that the exception occurs in the block of code:
it comes up after running for sometime...
pRange = pSheet->GetRange( _bstr_t("A3"), _bstr_t("CQ9990") );<br />
<br />
for ( int iRow = 1;iRow <= N; iRow++)<br />
{<br />
for (int iColumn = 1; iColumn < N2; ++iColumn )<br />
{ <br />
_variant_t vItem = pRange->Item[(long) iRow ][ (long) iColumn];<br />
_bstr_t bstrText( vItem );<br />
raw_data[iRow][iColumn] = vItem;<br />
<br />
}<br />
}
|
|
|
|
|
Hi all,
i have two CUIntArray,i want to merge it and generate new CUIntArray,
but want no comman values are inserted in new array.
help me for this.
|
|
|
|
|
Le@rner wrote: but want no comman values are inserted in new array
And... what do you want ?
(could you write some formula, like: C[i] = A[i] | B[i] ?)
virtual void BeHappy() = 0;
|
|
|
|
|
i want if A[i]={a,c,e,d}
and B[i]={a,c,f,g}
than result is C[i]={a,c,d,e,f,g}
|
|
|
|
|
If the array are sorted (like the sample posted) then your task is almost trivial.
[added]
OK, I see array A is actually NOT ordered.
What is your requirement about?
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Friday, April 9, 2010 8:30 AM
|
|
|
|
|
A (maybe needed to be optimized) version :
void ProcessMerging(CUIntArray* pcaResult,
const CUIntArray& caFirst,
const CUIntArray& caSecond)
{
if (pcaResult) {
pcaResult->RemoveAll();
int iFirstSize(caFirst.GetSize()),
iSecondSize(caSecond.GetSize()),
iMaxSize(max(iFirstSize, iSecondSize));
for (int i = 0; i < iMaxSize; i++) {
bool bFirstPresented(i < iFirstSize),
bSecondPresented(i < iSecondSize);
if (bFirstPresented) {
pcaResult->Add(caFirst[i]);
if (bSecondPresented &&
caFirst[i] != caSecond[i]) {
pcaResult->Add(caSecond[i]);
}
} else {
pcaResult->Add(caSecond[i]);
}
}
}
}
virtual void BeHappy() = 0;
modified on Friday, April 9, 2010 7:27 AM
|
|
|
|
|
I guess it doesn't work even for sorted arrays (I suppose you should use two different indices).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Right, now it is a "per-index merging" only...
virtual void BeHappy() = 0;
|
|
|
|