61 DEBUG_INFO(
"DESTRUCTOR: CLogWndDoc: START\n");
63 while(m_locked) ::Sleep(10);
68 DEBUG_INFO(
"DESTRUCTOR: CLogWndDoc: END\n");
84 if (!CDocument::OnNewDocument())
return FALSE;
113 CDocument::AssertValid();
132 CDocument::DeleteContents();
139 POSITION pos = GetFirstViewPosition();
154 while (!
lock.IsLocked()) {
175 while (!
lock.IsLocked()) {
187 for (
int pos=0; pos<
ringBuffer->getMaxLineY(); pos++) {
188 Buffer buf = dup_Buffer(
ringBuffer->pBuf[pos]);
189 if (
ringBuffer->getKindData(pos)!=LOG_RB_BINARY_DATA) {
190 if (buf.buf[buf.vldsz-1]!=
'\n') cat_s2Buffer(
"\n", &buf);
192 fwrite((
const char*)buf.buf, strlen((
const char*)buf.buf), 1, fp);
193 size += (int)strlen((
const char*)buf.buf);
207 CString str = _T(
"");
209 memset(fn, 0, LNAME);
210 memset(&ofn, 0,
sizeof(OPENFILENAME));
212 ofn.lStructSize =
sizeof(OPENFILENAME);
213 ofn.hwndOwner = hWnd;
217 ofn.nMaxFile =
sizeof(fn) /
sizeof(fn[0]);
218 ofn.lpstrTitle = title;
220 BOOL ret = GetSaveFileName(&ofn);
236 int no = 0, trymax = 100;
240 while (!
lock.IsLocked() && no<trymax) {
250 ringBuffer->rewriteBinHexRingBuffer(lastPos-1, input);
254 InvalidateRect(
pView->m_hWnd, NULL, FALSE);
264 Buffer buf = make_Buffer_bystr(msg);
276 int no = 0, trymax = 100;
280 while (!
lock.IsLocked() && no<trymax) {
293 InvalidateRect(
pView->m_hWnd, NULL, FALSE);
303 int no = 0, trymax = 100;
307 while (!
lock.IsLocked() && no<trymax) {
315 ringBuffer->putRingFormat(LOG_RB_MESG, fmt, args);
320 InvalidateRect(
pView->m_hWnd, NULL, FALSE);
338 ringBuffer->rewriteBinHexRingBuffer(lastPos-1, input);
341 InvalidateRect(
pView->m_hWnd, NULL, FALSE);
351 Buffer buf = make_Buffer_bystr(msg);
368 InvalidateRect(
pView->m_hWnd, NULL, FALSE);
380 ringBuffer->putRingFormat(LOG_RB_MESG, fmt, args);
383 InvalidateRect(
pView->m_hWnd, NULL, FALSE);
CLogRingBuffer * ringBuffer
void DeleteContents(void)
virtual BOOL OnNewDocument()
virtual void lprintString(char *str, int input=LOG_RB_MESG)
virtual void lfprintFormat(int input, char *fmt,...)
virtual void printBuffer(Buffer buf, int input=LOG_RB_MESG)
virtual void lprintBuffer(Buffer buf, int input=LOG_RB_MESG)
virtual void fprintFormat(int input, char *fmt,...)
CLogWndView * GetView(void)
virtual void lprintFormat(char *fmt,...)
virtual void Serialize(CArchive &ar)
CCriticalSection criticalKey
virtual void AssertValid() const
CString easyGetSaveFileName(LPCTSTR title, HWND hWnd)
virtual void Dump(CDumpContext &dc) const
virtual void printFormat(char *fmt,...)
virtual void printString(char *str, int input=LOG_RB_MESG)
CLogWndDoc * GetDocument() const