These two errors are basically a problem. Access out of bounds.
In the program, I defined a cstring Class Object Str. Call sprintf (lpstr) (lpctstr) STR, "futures Forex, % 4D, % s, % 4D", m_sendata.m_datatime, m_sendata.m_pdataqh.code, m_sendata.m_pdataqh.buyin );
Change the STR value. The preceding dialog box is displayed.
Solution: STR is a char * In sprintf and is assigned to it with an excessively long string to generate access out of bounds.
The cause is that STR is not initialized. When an empty address is accessed or the access is out of bounds.
Note: No error occurs in the release version.
There are several reasons for this access error that does not belong to your memory space:
1. Allocate a small memory space to an array, and then assign a large value to the array.
Solution: allocate more memory space to the array, such as char Buf [1000];
2. The handle or pointer is released before use.
Solution: Check the code for debugging and pull out the wild pointer.