1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

VC++ problem, please help

Discussion in 'C++' started by lqq889, Apr 1, 2010.

  1. lqq889

    lqq889 New Member

    Joined:
    Apr 1, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    can anyone please help me to check the below codings see got any error,why i can not show the red color if i change the name? the purpose of the below coding is to check if got any changes must be reflected in red, otherwise is black


    buf=GetJobItem(tmpJobNew,1); buf.TrimRight(); if(buf.GetLength()>0) { if((tmpJobNew.wOfferMask & 0x4000) != 0) { dc.SetTextColor(RED); } else { dc.SetTextColor(BLACK); } dc.ExtTextOut(leftStart,topStart,ETO_OPAQUE,NULL, _T("Name:"), NULL); tmp=GetJobItem(tmpJobNew, 2); //tmp.TrimRight(); if (tmp.GetLength()>0) { tmp.Format(_T(" (%s)"),tmpJobNew); //buf+=_T(", "); buf=buf+tmp; } #if defined(IVD_SAPPHIRE) dc.ExtTextOut(50+leftStart,topStart,ETO_OPAQUE,NULL,buf, NULL);#else dc.ExtTextOut(100+leftStart,topStart,ETO_OPAQUE,NULL,buf, NULL);#endif topStart=topStart+nHeight; }
     
  2. lqq889

    lqq889 New Member

    Joined:
    Apr 1, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    i reupload the code in a txt format...
     

    Attached Files:

    • code.txt
      File size:
      700 bytes
      Views:
      4
  3. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    If you use code blocks (described in the posting guidelines...you did read them, didn't you?) then formatting is preserved:
    Code:
    buf=GetJobItem(tmpJobNew,1);
    buf.TrimRight(); 
    if(buf.GetLength()>0) 
    { 
    	if((tmpJobNew.wOfferMask & 0x4000) != 0) 
    	{ 
    		dc.SetTextColor(RED); 
    	} 
    	else 
    	{ 
    		dc.SetTextColor(BLACK); 
    	} 
    	dc.ExtTextOut(leftStart,topStart,ETO_OPAQUE,NULL, _T("Name:"), NULL); 
    	tmp=GetJobItem(tmpJobNew, 2); 
    	//tmp.TrimRight(); 
    	if (tmp.GetLength()>0) 
    	{ 
    		tmp.Format(_T(" (%s)"),tmpJobNew); 
    		//buf+=_T(", "); 
    		buf=buf+tmp; 
    	} 
    #if defined(IVD_SAPPHIRE)
    	dc.ExtTextOut(50+leftStart,topStart,ETO_OPAQUE,NUL L,buf, NULL);
    #else 
    	dc.ExtTextOut(100+leftStart,topStart,ETO_OPAQUE,NU LL,buf, NULL);
    #endif topStart=topStart+nHeight; 
    }
    
     

Share This Page