本文整理汇总了C++中DebugStr函数的典型用法代码示例。如果您正苦于以下问题:C++ DebugStr函数的具体用法?C++ DebugStr怎么用?C++ DebugStr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DebugStr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DefTermLogString
void DefTermLogString(LPCWSTR asMessage, LPCWSTR asLabel /*= NULL*/)
{
if (!asMessage || !*asMessage)
{
return;
}
// To ensure that we may force debug output for troubleshooting
// even from non-def-term-ed applications
if (!gpDefTerm)
{
DebugStr(asMessage);
if (asMessage[lstrlen(asMessage) - 1] != L'\n')
{
DebugStr(L"\n");
}
return;
}
LPCWSTR pszReady = asMessage;
CEStr lsBuf;
if (asLabel && !asLabel)
{
lsBuf = lstrmerge(asLabel, asMessage);
if (lsBuf.ms_Arg)
pszReady = lsBuf.ms_Arg;
}
gpDefTerm->LogHookingStatus(pszReady);
}
示例2: show_alloc_list
void show_alloc_list(void) {
HeapStruct *alist = alloc_list;
DebugStr("\n-------------------\n");
while (alist) {
DebugStr("Head = %x, Tail = %x, Payload Head = %x, Payload Tail = %x\n",
alist->bk_head, alist->bk_tail, alist->pl_head, alist->pl_tail);
DebugStr("-------------------\n");
alist = alist->next;
}
}
示例3: GetHandle
void AWinControlBase::ShowModal()
{
AControl* pParent = dynamic_cast<AControl*>(GetParent());
//if( pParent ) pParent->Refresh();
HWND hWndParent = (pParent ? pParent->GetUICore()->GetHandle() : NULL );
HWND hFirstParent = hWndParent;
HWND hWnd = GetHandle();
//显示自己
//ShowWindow(hWnd, SW_SHOW);
//BringWindowToTop(hWnd);
//if( pParent ) pParent->Refresh();
//disable掉父窗口
while(hWndParent != NULL)
{
EnableWindow(hWndParent, FALSE);
//::InvalidateRect(hWndParent,NULL,FALSE);
//::UpdateWindow(hWndParent);
hWndParent = ::GetParent(hWndParent);
}
SetVisible(true);
m_bModal = true;
m_pWindow->SetPostQuitFlag(true);
//接管消息循环
DebugStr(_T("\r\nBegin modalWin.Run"));
while(true)
{
MSG msg;
if (!GetMessage(&msg, NULL, 0, 0))
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
DebugStr(_T("\r\nEnd ModalWin.Run"));
//将自己隐藏
ShowWindow(hWnd, SW_HIDE);
//Close();
//模态已经退出
//恢复父窗口的enable状态
hWndParent = hFirstParent;
while (hWndParent != NULL)
{
EnableWindow(hWndParent, TRUE);
//::InvalidateRect(hWndParent,NULL,TRUE);
//::UpdateWindow(hWndParent);
hWndParent = ::GetParent(hWndParent);
}
SetForegroundWindow(hFirstParent);
//SetFocus(hFirstParent);
}
示例4: test15
void test15 ()
{
printf("\n\n<TEST 15> send many notes in the future\n");
DebugStr ("--> use g or G to send many notes in the future and go to the next test\n");
SendMultipleNotes(10, 60, 250);
printf("\n\n<TEST 15 bis> send more notes in the future\n");
DebugStr ("--> use g or G to send more notes in the future and go to the next test\n");
SendMultipleNotes(6, 60, 800);
SendMultipleNotes(8, 72, 600);
}
示例5: test12
void test12 ()
{
printf("\n\n<TEST 12> list the destinations of our application\n");
DebugStr ("--> use g or G to list the destinations of our application and go to the next test\n");
listOfDest(ourRefNum);
}
示例6: test10
void test10 ()
{
printf("\n\n<TEST 10> connect the output of 'MidiShare Tutorial' to 'MidiShare'\n");
DebugStr ("--> use g or G to make the connection and go to the next test\n");
MidiConnect(ourRefNum, 0, true);
}
示例7: test7
void test7 ()
{
printf("\n\n<TEST 7> search the reference number of 'MacOSX Tutorial'\n");
DebugStr ("--> use g or G to search the reference number of 'MacOSX Tutorial' and go to the next test\n");
printf("Reference number of '%#s' : %d\n", "MacOSX Tutorial", MidiGetNamedAppl("MacOSX_Tutorial"));
}
示例8: test6
void test6 ()
{
printf("\n\n<TEST 6> List every MidiShare client applications\n");
DebugStr ("--> use g or G to list every MidiShare client applications and go to the next test\n");
listOfAppl();
}
示例9: OpenThisDialog
static DialogPtr OpenThisDialog(StringPtr nameString, StringPtr descString)
{
short type; Handle hndl; Rect box; GrafPtr oldPort;
DialogPtr dlog; unsigned char *p,str[256];
DebugStr ( "/pOpenThisDialog" );
DPRINT (( "OpenThisDialog - nameString : %s descString : %s",
nameString, descString ));
return NIL;
GetPort(&oldPort);
dlog = GetNewDialog(thisDialogID,NIL,FRONT_WINDOW);
if (dlog == NIL) { SysBeep(1); return(NIL); } /* Poor man's error message */
CenterWindow(dlog,0);
SetPort(dlog);
// insert the initial values into our fields
PutDlgString(dlog, EDIT6, descString, FALSE);
PutDlgString(dlog, EDIT5, nameString, TRUE);
ShowWindow(dlog);
return(dlog);
}
示例10: Accept
// Try to accept a remote connection from client.
// Implement based on accept() and select()
// 1. Input:
// <1> socket
// <2> timeout : in ms
// - if > 0 block for timeout us
// - if = 0 non-blocking
// - if < 0 block forever if no remote connection
// <3> retry : currently does not support
// <4> client_addr: a pointer to a str buffer, length at least 100
// 2. Output:
// <1> client_addr : client ip address string
// <2> ret : client socket if success else -1
int Accept(int sock_fd, int timeout, int retry, char *client_addr) {
struct timeval tv, *tv_ptr;
if (timeout < 0) {
tv_ptr = NULL;
} else {
tv.tv_sec = timeout / 1000;
tv.tv_usec = timeout % 1000;
tv_ptr = &tv;
}
fd_set read_fds;
FD_ZERO(&read_fds);
FD_SET(sock_fd, &read_fds);
switch(select(sock_fd + 1, &read_fds, NULL, NULL, tv_ptr)) {
case 0: return 0; // timeout
case -1: return -1; // error
}
struct sockaddr_storage addr;
socklen_t addr_size = sizeof(addr);
int client_fd = accept(sock_fd, (struct sockaddr *)&addr, &addr_size);
if (client_fd == -1) {
unix_error("Accpet:");
}
const int MAXSIZE = 100;
if (client_addr) {
inet_ntop(addr.ss_family, get_in_addr((struct sockaddr *)&addr),
client_addr, MAXSIZE);
DebugStr("Server: got connections from %s\n", client_addr);
}
return client_fd;
}
示例11: __assert
short __assert (char *expr, char *file, short line) {
bigstring bsfile, bsline, bsmessage;
static boolean flnorentry = false;
if (flnorentry)
return (0);
flnorentry = true;
moveleft (file, bsfile, (long) lenbigstring);
convertcstring (bsfile);
numbertostring ((long) line, bsline);
parsedialogstring (
"\pAssertion failed in file ^0, at line ^1.",
bsfile, bsline, nil, nil,
bsmessage);
DebugStr (bsmessage);
flnorentry = false;
return (0);
} /*__assert*/
示例12: dprintf
int dprintf(
const char *format,
...)
{
char buffer[257]; /* [length byte] + [255 string bytes] + [null] */
va_list arglist;
int return_value;
if (debug_status)
{
va_start(arglist, format);
return_value= vsprintf(buffer+1, format, arglist);
va_end(arglist);
*buffer= strlen(buffer+1);
#ifdef DEBUG
if (debugger_installed)
{
DebugStr((StringPtr)buffer);
}
else
#endif
{
ParamText((StringPtr)buffer, (StringPtr)"\p?", (StringPtr)"", (StringPtr)"");
Alert(alrtNONFATAL_ERROR, (ModalFilterUPP) NULL);
ParamText((StringPtr)"", (StringPtr)"", (StringPtr)"", (StringPtr)"");
}
}
else
{
示例13: test13
void test13 ()
{
printf("\n\n<TEST 13> list the sources of the MidiShare output driver\n");
DebugStr ("--> use g or G to list the sources of the MidiShare output driver and go to the next test\n");
listOfSrc(0);
}
示例14: test14
void test14 ()
{
printf("\n\n<TEST 14> send a note\n");
DebugStr ("--> use g or G to send a note and go to the next test\n");
sendNote(60);
}
示例15: jsdebugstr
static void jsdebugstr(const char *debuggerMsg)
{
Str255 pStr;
PStrFromCStr(debuggerMsg, pStr);
DebugStr(pStr);
}