示例#1
0
文件: comm.c 项目: Carrotman42/cs4534
// Will check whether the message header matches an error message. In this case it prints
//   it on the LCD. TODO: Tell the webserver that something is wrong.
inline void checkError(char* ret) {
	if (!(ret[0] & ERROR_FLAG)) {
		return;
	}
	
	bBuf(30);
	bStr("ERR: ");
	bByte(ret[1]);
	bPrint(6);
	
	dbg(Error, ret[1]);
}
示例#2
0
BOOL CQListCtrl::DrawRtfText(int nItem, CRect &crRect, CDC *pDC)
{
	if(g_Opt.m_bDrawRTF == FALSE)
		return FALSE;
	
	BOOL bRet = FALSE;

	CClipFormat* pThumbnail = GetItem_CF_RTF_ClipFormat(nItem);
	if(pThumbnail == NULL)
		return FALSE;

	// if there's no data, then we're done.
	if(pThumbnail->m_hgData == NULL)
		return FALSE;

	if(m_pFormatter == NULL)
	{
		m_pFormatter = new CFormattedTextDraw;
		m_pFormatter->Create();
	}

	if(m_pFormatter)
	{
	   char *pData = (char*)GlobalLock(pThumbnail->m_hgData);
	   if(pData)
	   {
		   CComBSTR bStr(pData);
		   
		   m_pFormatter->put_RTFText(bStr);
		   
		   m_pFormatter->Draw(pDC->m_hDC, crRect);

		   GlobalUnlock(pThumbnail->m_hgData);

		   bRet = TRUE;
	   }
	}

	return bRet;
}