Click here to Skip to main content
15,914,322 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error while compiling code Pin
izyani4-Nov-08 14:47
izyani4-Nov-08 14:47 
GeneralRe: Error while compiling code Pin
CPallini4-Nov-08 21:30
mveCPallini4-Nov-08 21:30 
AnswerRe: Error while compiling code Pin
Varghese Paul M4-Nov-08 1:02
Varghese Paul M4-Nov-08 1:02 
GeneralRe: Error while compiling code Pin
izyani4-Nov-08 14:47
izyani4-Nov-08 14:47 
GeneralRe: Error while compiling code Pin
izyani4-Nov-08 21:33
izyani4-Nov-08 21:33 
QuestionLoadBitMap giving error Pin
Dhiraj kumar Saini3-Nov-08 22:13
Dhiraj kumar Saini3-Nov-08 22:13 
AnswerRe: LoadBitMap giving error Pin
CPallini3-Nov-08 22:46
mveCPallini3-Nov-08 22:46 
GeneralRe: LoadBitMap giving error Pin
Dhiraj kumar Saini3-Nov-08 22:56
Dhiraj kumar Saini3-Nov-08 22:56 
I am sending you the code
void CChatDlg::InternalAppendTextinRichEdit(LPCTSTR szText)
{
int len;

	ASSERT(szText);
	ASSERT(AfxIsValidString(szText));

	CWnd * pWnd = (CWnd*) GetDlgItem(IDC_TRANSCRIPT); 

	CString strToInsert = szText;
	strToInsert.MakeLower();
	CString strTemp = g_ChatManager.GetCurrentCSR();
	strTemp.MakeLower();
	COLORREF color;
	if(0 == strToInsert.Find(strTemp))
	{
		//csr
		color = RGB(185,0,0);
	}
	else if(-1 != strToInsert.Find(_T(":")))
	{
		//colon is there now check if it is notice
		int n = strToInsert.Find(_T("notice"));
		if(0 == n)
		{
			//Notice
			color = RGB(0,128,0);
			CString str1 = _T("notice:now user has join the chat");
			if(0==strToInsert.Find(str1))
			{
				CheckVisitorNameandMail();
			}
		}
		else
		{
			//visitor msg
			color = RGB(0,0,255);
			SetDlgItemText(IDC_STATIC_STATUS,_T(""));
		}
	}
	else
	{
		//new user has joined
		color = RGB(0,128,0);
	}
	//code added by dhiraj for Bitmap Loading-------
	CString strText = szText;
	CString strtemp = szText;
	CString strFinal;
	int first=0,start,end,last,length;
	//CBitmap m_bitmap;
	if((strToInsert.Find('[',0)>=0))
	{
		m_cfDefault.crTextColor = color;
		m_richEdit.SetSelectionCharFormat(m_cfDefault);
		int option = 0 ;
		CWnd *focusWnd = GetFocus();
		int	 iTotalTextLength = m_richEdit.GetWindowTextLength();
	while(strText.GetLength()>0)
	{
		CBitmap m_bitmap;
		first = 0;
		
		length = strText.GetLength();
		//start = strText.Find(_T("[:)]"),first);
		//start = strText.Find(_T("[:D]"),first);
		if(strText.Find(_T("[:)]"),first)>=0)
		{
			option = 1;
			start = strText.Find(_T("[:)]"),first);
		}

		else if(strText.Find(_T("[:D]"),first)>=0)
		{
			option = 2;
			start = strText.Find(_T("[:D]"),first);
		}
		if(option == 1)
		{
		end = start + 3;
		CString f = strText.Mid(first,start);
		if(f!=_T(""))
		m_richEdit.ReplaceSel(f);
		CString e = strtemp.Mid(end+1,length);
		//m_richEdit.SetSel(start,start+4);
		m_bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_HAPPY));
		//InsertBitmap((HWND)pWnd, (HBITMAP)m_bitmap);
		InsertPlotBitmap((HBITMAP)m_bitmap);
		delete(m_bitmap);
		
		strFinal = e ;
		strText = strFinal;
		strtemp = strFinal;
		}
		else if(option == 2)
		{
		end = start + 3;
		CString f = strText.Mid(first,start);
		if(f!=_T(""))
		m_richEdit.ReplaceSel(f);
		CString e = strtemp.Mid(end+1,length);
		//m_richEdit.SetSel(start,start+4);
		 
		m_bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_BIGGRIN));
		//InsertBitmap((HWND)pWnd, (HBITMAP)m_bitmap);
		InsertPlotBitmap((HBITMAP)m_bitmap);
		delete(m_bitmap);
		
		strFinal = e ;
		strText = strFinal;
		strtemp = strFinal;
		}
		else
		{
			m_richEdit.ReplaceSel(strText);
			strText = _T("");
		}
	}
}


Thanks
QuestionRe: LoadBitMap giving error Pin
CPallini3-Nov-08 23:30
mveCPallini3-Nov-08 23:30 
AnswerRe: LoadBitMap giving error Pin
Dhiraj kumar Saini3-Nov-08 23:56
Dhiraj kumar Saini3-Nov-08 23:56 
QuestionVisual Studio 2005 Tiny Cursor Pin
Daniel Kanev3-Nov-08 21:43
Daniel Kanev3-Nov-08 21:43 
QuestionUpdating a SLT map Pin
CodingLover3-Nov-08 21:39
CodingLover3-Nov-08 21:39 
NewsRe: Updating a SLT map Pin
CodingLover3-Nov-08 21:44
CodingLover3-Nov-08 21:44 
QuestionCreate two executable files ( one GUI and one command line ) Pin
Arif Liminto3-Nov-08 20:51
professionalArif Liminto3-Nov-08 20:51 
AnswerRe: Create two executable files ( one GUI and one command line ) Pin
Cedric Moonen3-Nov-08 20:56
Cedric Moonen3-Nov-08 20:56 
GeneralRe: Create two executable files ( one GUI and one command line ) Pin
Arif Liminto3-Nov-08 21:11
professionalArif Liminto3-Nov-08 21:11 
GeneralRe: Create two executable files ( one GUI and one command line ) Pin
Cedric Moonen4-Nov-08 1:16
Cedric Moonen4-Nov-08 1:16 
GeneralRe: Create two executable files ( one GUI and one command line ) Pin
Arif Liminto5-Nov-08 15:16
professionalArif Liminto5-Nov-08 15:16 
AnswerRe: Create two executable files ( one GUI and one command line ) Pin
KarstenK3-Nov-08 21:16
mveKarstenK3-Nov-08 21:16 
QuestionHow to block right click menu (Context Menu) on MS-Office documents. Pin
SNI3-Nov-08 19:41
SNI3-Nov-08 19:41 
AnswerRe: How to block right click menu (Context Menu) on MS-Office documents. Pin
Nishad S4-Nov-08 1:45
Nishad S4-Nov-08 1:45 
QuestionSmartDevice (wincows mobile) program Pin
zon_cpp3-Nov-08 19:23
zon_cpp3-Nov-08 19:23 
Questiondiffrence between IT and IAT Pin
zon_cpp3-Nov-08 19:21
zon_cpp3-Nov-08 19:21 
QuestionCreating a csv file in a dialog based MFC application Pin
SeshaSridhar3-Nov-08 19:08
SeshaSridhar3-Nov-08 19:08 
AnswerRe: Creating a csv file in a dialog based MFC application Pin
Chandrasekharan P3-Nov-08 19:19
Chandrasekharan P3-Nov-08 19:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.