CString buffer length - how to increase and monitor? 
Author Message
 CString buffer length - how to increase and monitor?

I am buliding long SQL query by concatenating
CString "object". I have two problems - the concatenation
stops( actually it continues but does not add any more
characters to the buffer)  without any error indication
after what appears to be about 255 characters are in the
CString buffer.
Is there a way to convince CString to inform me that it
cannot add any more characters together?? Monitoring the
bufffer fill??
Second, where is this buffer length defined and how do you
change it? I have stepped thru MFC but cannot see it
anywhere.
The explanation of "GetBuffer" did not help me to find a
solution either.
Thanks for your help. Vaclav

PS I am going to try CStr class , but would like to
continue using CString if possible.



Sat, 06 Aug 2005 21:38:06 GMT  
 CString buffer length - how to increase and monitor?
CString shouldn't have any problem adding more than 255 chars. How are you
determining that this is the case?
--
Jeff Partch [VC++ MVP]


Quote:
> I am buliding long SQL query by concatenating
> CString "object". I have two problems - the concatenation
> stops( actually it continues but does not add any more
> characters to the buffer)  without any error indication
> after what appears to be about 255 characters are in the
> CString buffer.
> Is there a way to convince CString to inform me that it
> cannot add any more characters together?? Monitoring the
> bufffer fill??
> Second, where is this buffer length defined and how do you
> change it? I have stepped thru MFC but cannot see it
> anywhere.
> The explanation of "GetBuffer" did not help me to find a
> solution either.
> Thanks for your help. Vaclav

> PS I am going to try CStr class , but would like to
> continue using CString if possible.



Sat, 06 Aug 2005 21:45:14 GMT  
 CString buffer length - how to increase and monitor?
See if the following add-in helps you

            http://www.geocities.com/ivasha.geo/rar/

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------


Quote:
> I am buliding long SQL query by concatenating
> CString "object". I have two problems - the concatenation
> stops( actually it continues but does not add any more
> characters to the buffer)  without any error indication
> after what appears to be about 255 characters are in the
> CString buffer.
> Is there a way to convince CString to inform me that it
> cannot add any more characters together?? Monitoring the
> bufffer fill??
> Second, where is this buffer length defined and how do you
> change it? I have stepped thru MFC but cannot see it
> anywhere.
> The explanation of "GetBuffer" did not help me to find a
> solution either.
> Thanks for your help. Vaclav

> PS I am going to try CStr class , but would like to
> continue using CString if possible.



Sat, 06 Aug 2005 21:56:38 GMT  
 CString buffer length - how to increase and monitor?
Hi Vaclav,

CString is not limited to 255 chars. There should be something wrong with
your code, if you can post some code we will try to help.

--
Regards,
  Kobi Ben Tzvi


Quote:
> I am buliding long SQL query by concatenating
> CString "object". I have two problems - the concatenation
> stops( actually it continues but does not add any more
> characters to the buffer)  without any error indication
> after what appears to be about 255 characters are in the
> CString buffer.
> Is there a way to convince CString to inform me that it
> cannot add any more characters together?? Monitoring the
> bufffer fill??
> Second, where is this buffer length defined and how do you
> change it? I have stepped thru MFC but cannot see it
> anywhere.
> The explanation of "GetBuffer" did not help me to find a
> solution either.
> Thanks for your help. Vaclav

> PS I am going to try CStr class , but would like to
> continue using CString if possible.



Sat, 06 Aug 2005 21:50:42 GMT  
 CString buffer length - how to increase and monitor?
Thanks for such fast reply.

Here is unedited snippet of my code, note that I have
added "partialQuery_x"  for testing purposes.

query = " INSERT INTO ";
query += "[" + query_Color;
query +=  query_Complex + "] ";
query += " ( [" + query_ID + " ],[ ";
query += query_Color ;
query += query_Complex + "Index" + " ], ";

for(j = 1; j < MAX_OUTPUT-1 ; j++){
        strValue.Format("%i",j);
        query += "[ Output_" + strValue + " ],";

Quote:
}

This is where the concatenation stops !!!

partialQuery_1 = query;
// last one
strValue.Format("%i",j);
query = "[ Output_" + strValue + " ]";      // no ending comma

//query += "[RedReal] ";
//query += "([REDID],[RedRealIndex],[Output_1],[Output_2],
[Output_3],[Output_4],[Output_5],[Output_6],[Output_7],
[Output_8]) ";
query += " VALUES ";
query += "(";
query += strm_Object + ",";

query += strIndex + ",";

// output values loop - last one
for(j = 0; j< MAX_OUTPUT;j++){
        strValue.Format("%f",m_Net.OutputLayer->Weight[i]
[j]);
        query += strValue;
        query += ",";
        }

partialQuery_2 = query;

// last value
strValue.Format("%f",m_Net.OutputLayer->Weight[i][j]);
query = strValue;
query += ")";

partialQuery_3 = query;
query =partialQuery_1+ partialQuery_2+partialQuery_3;

// insert data to database
m_pSQL->m_pDatabase->ExecuteSQL(query);

Quote:
>-----Original Message-----
>I am buliding long SQL query by concatenating
>CString "object". I have two problems - the concatenation
>stops( actually it continues but does not add any more
>characters to the buffer)  without any error indication
>after what appears to be about 255 characters are in the
>CString buffer.
>Is there a way to convince CString to inform me that it
>cannot add any more characters together?? Monitoring the
>bufffer fill??
>Second, where is this buffer length defined and how do
you
>change it? I have stepped thru MFC but cannot see it
>anywhere.
>The explanation of "GetBuffer" did not help me to find a
>solution either.
>Thanks for your help. Vaclav

>PS I am going to try CStr class , but would like to
>continue using CString if possible.

>.



Sat, 06 Aug 2005 22:01:45 GMT  
 CString buffer length - how to increase and monitor?

Quote:

> I am buliding long SQL query by concatenating
> CString "object". I have two problems - the concatenation
> stops( actually it continues but does not add any more
> characters to the buffer)  without any error indication
> after what appears to be about 255 characters are in the
> CString buffer.

This is a common misunderstanding.  CString has no such limit, but the
TRACE macro that dumps strings to the de{*filter*} window does have a limit
like this.  To see all of your CString you can display it in the watch
window or pass it to OutputDebugString (which is where TRACE sends it).

--
Scott McPhillips [VC++ MVP]



Sat, 06 Aug 2005 22:07:58 GMT  
 CString buffer length - how to increase and monitor?


Wed, 18 Jun 1902 01:00:00 GMT  
 CString buffer length - how to increase and monitor?
Horray, it works wonderfull! This is a great tool!!
The problem was the hammer I am using.Pardon me, VC++
editor limitation of too few characters showing!.

Thanks a lot.

Vaclav
PS. Besides some bugs in my SQL string.LOL!



Sat, 06 Aug 2005 22:45:33 GMT  
 CString buffer length - how to increase and monitor?


Wed, 18 Jun 1902 01:00:00 GMT  
 CString buffer length - how to increase and monitor?
Scott, it did not show up in watch!Apparenly watch window
has same 250 characters limitation. I did not use TRACE,
but I will give it a try to see if that works better.


Sat, 06 Aug 2005 22:49:17 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Q:increased buffer

2. increase size of output window buffer?

3. Increasing anonymous pipe buffer

4. Writing directly to monitor without buffering - Implementation

5. Buffer sizes and string lengths

6. buffer with undefined length

7. TDS Buffer Length Too Large

8. CAsyncSocket and receive buffer length

9. socket buffer length

10. get data length in serial port buffer?

11. Setting the receive buffer length does not work with CAsyncSocket

12. View CString length in debugger

 

 
Powered by phpBB® Forum Software