Click here to Skip to main content
15,890,377 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Would you all call this namespace abuse? Pin
Alain Rist3-Feb-11 20:31
Alain Rist3-Feb-11 20:31 
QuestionRe: Would you all call this namespace abuse? Pin
bob169724-Feb-11 5:03
bob169724-Feb-11 5:03 
QuestionChange Image size Pin
john56322-Feb-11 20:32
john56322-Feb-11 20:32 
AnswerRe: Change Image size Pin
Madhu Nair2-Feb-11 21:17
Madhu Nair2-Feb-11 21:17 
AnswerRe: Change Image size Pin
S p k 5213-Feb-11 1:00
S p k 5213-Feb-11 1:00 
AnswerRe: Change Image size Pin
Cool_Dev3-Feb-11 2:01
Cool_Dev3-Feb-11 2:01 
QuestionError in Release() throw function Pin
Anu_Bala2-Feb-11 19:30
Anu_Bala2-Feb-11 19:30 
AnswerRe: Error in Release() throw function Pin
Andrew Brock2-Feb-11 19:43
Andrew Brock2-Feb-11 19:43 
Why are you using strings? This is slow and pointless.
You should read up on bitwise operations[^] such as shift and AND

struct SLEDFrame {
	BYTE idtfr;
	BYTE Data1;
	BYTE Data2;
};

SLEDFrame btnLED[] = {
	{ 0x53, 0x30, 0x30 }, 					
	{ 0x53, 0x30, 0x31 },  			
	{ 0x53, 0x30, 0x32 },  			
	{ 0x53, 0x30, 0x33 },  			
	{ 0x53, 0x30, 0x34 },  		
	{ 0x53, 0x30, 0x35 }, 
}

void CMSCOMMDlg::setLED(int pLEDNo, BOOL pState) {
	BYTE bState;
	if (pState) {
		bState = 0x31;   //ON
	} else  {
		bState = 0x30;   //OFF
	}
	BYTE bID = btnLED[pLEDNo-1].idtfr;
	BYTE bByte1 = btnLED[pLEDNo-1].Data1;
	BYTE bByte2 = btnLED[pLEDNo-1].Data2;
	BYTE bSum = bByte1 + bByte2 + bState; 	
	BYTE bCheckSumByte1 = 0x30 | (bSum >> 4);
	BYTE bCheckSumByte2 = 0x30 | (bSum & 0x0F);
	
	//To send data use this code:
	CByteArray btArray;
	btArray.Add(bID); 	  //Identifier byte
	btArray.Add(bByte1); // DataByte 1
	btArray.Add(bByte2); // DataByte 2
	btArray.Add(bState); //Status Byte
	btArray.Add(bCheckSumByte1); //CheckSumByte1
	btArray.Add(bCheckSumByte2); //CheckSumByte2
	
	COleVariant var(btArray);
	m_Comm.SetOutput(var);	// Send the data.
}

GeneralRe: Error in Release() throw function Pin
Anu_Bala2-Feb-11 20:05
Anu_Bala2-Feb-11 20:05 
GeneralRe: Error in Release() throw function Pin
Andrew Brock2-Feb-11 20:35
Andrew Brock2-Feb-11 20:35 
GeneralRe: Error in Release() throw function Pin
Richard MacCutchan2-Feb-11 21:54
mveRichard MacCutchan2-Feb-11 21:54 
QuestionGetting the error Link2001: unresolved reference to the function Pin
charanmanjunath2-Feb-11 18:14
charanmanjunath2-Feb-11 18:14 
AnswerRe: Getting the error Link2001: unresolved reference to the function Pin
_AnsHUMAN_ 2-Feb-11 18:20
_AnsHUMAN_ 2-Feb-11 18:20 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath2-Feb-11 18:25
charanmanjunath2-Feb-11 18:25 
AnswerRe: Getting the error Link2001: unresolved reference to the function Pin
Andrew Brock2-Feb-11 18:25
Andrew Brock2-Feb-11 18:25 
AnswerRe: Getting the error Link2001: unresolved reference to the function Pin
ShilpiP2-Feb-11 18:37
ShilpiP2-Feb-11 18:37 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath2-Feb-11 19:19
charanmanjunath2-Feb-11 19:19 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath2-Feb-11 19:30
charanmanjunath2-Feb-11 19:30 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
_AnsHUMAN_ 2-Feb-11 20:35
_AnsHUMAN_ 2-Feb-11 20:35 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath3-Feb-11 4:19
charanmanjunath3-Feb-11 4:19 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath3-Feb-11 7:05
charanmanjunath3-Feb-11 7:05 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
Stefan_Lang3-Feb-11 21:29
Stefan_Lang3-Feb-11 21:29 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath3-Feb-11 22:36
charanmanjunath3-Feb-11 22:36 
GeneralRe: Getting the error Link2001: unresolved reference to the function Pin
charanmanjunath8-Feb-11 3:10
charanmanjunath8-Feb-11 3:10 
QuestionMemory deallocation Pin
csrss2-Feb-11 4:16
csrss2-Feb-11 4:16 

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.