In the debugging process, sometimes the characters are too long. In the debugging environment of VC, the default display length is limited, which may be 256. Trace (STR) is used) the function can display 512 characters, but if the character is longer than this, the characters displayed in the middle cannot be known during debugging.
of course, debugging is rare for such a long period of time. However, when writing data words to construct SQL statements, it is easy to generate a long character, in this case, it is very difficult to do it in the middle. Sometimes I print it into the text box, but it is too troublesome. One way to think of today is to use a file to write those long strings to the file, so that you can see the text you need.
Code :
cfile file;
file. open ("outdata.txt", cfile: modecreate | cfile: modewrite);
file. seektobegin ();
file. write (unsigned char *) (exesql. getbuffer (0), exesql. getlength ();
file. flush ();
file. close ();
Add this section to output them to the text.
you can copy it to the clipboard and copy it out through code. The following is its Code
cstring source = exesql;
// Save the text content in the source variable
If (openclipboard ()
{< br> hglobal clipbuffer;
char * buffer;
emptyclipboard ();
clipbuffer = globalalloc (gmem_ddeshare, source. getlength () + 1);
buffer = (char *) globallock (clipbuffer);
strcpy (buffer, lpcstr (source ));
globalunlock (clipbuffer);
setclipboarddata (cf_text, clipbuffer);
closeclipboard ();
}