Click here to Skip to main content
15,889,874 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Would you all call this namespace abuse? Pin
Stefan_Lang3-Feb-11 21:55
Stefan_Lang3-Feb-11 21:55 
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 
Im using VS2008.
Im sending data to LED in external device thorugh serial port by given in set of format for glowing LED.
But it show error on Release() in nRef!=0 line.
Actually it works fine in VC6.0Now im converting that to VS2008.

struct SLEDFrame
{
	char *idtfr,*Data1,*Data2;
};

SLEDFrame btnLED[] = {
						
"0x53", "0x30", "0x30", 		//0			
"0x53", "0x30", "0x31",  		//1	
"0x53", "0x30", "0x32",  		//2	
"0x53", "0x30", "0x33",  		//3	
"0x53", "0x30", "0x34",  		//4
};

void CMSCOMMDlg::setLED(int pLEDNo, BOOL pState)
{

	BYTE bID, bByte1, bByte2, bState, bCheckSumByte1, bCheckSumByte2;

	if (pState)
		bState = 0x31;   //ON
	else 
		bState = 0x30;   //OFF
	

CString tempStr, C1, C2;

tempStr = btnLED[pLEDNo-1].idtfr;
tempStr = tempStr.Mid(2);    
sscanf(tempStr, "%x", &bID);

tempStr = btnLED[pLEDNo-1].Data1;
tempStr = tempStr.Mid(2);    
sscanf(tempStr, "%x", &bByte1);

tempStr = btnLED[pLEDNo-1].Data2;
tempStr = tempStr.Mid(2);    
sscanf(tempStr, "%x", &bByte2);

BYTE bSum = bByte1 + bByte2 + bState; 	
tempStr.Format("%x",bSum);

C1 = "0x3" + tempStr.Left(1);
C2 = "0x3" + tempStr.Right(1);
sscanf(C1, "%x", &bCheckSumByte1);
sscanf(C2, "%x", &bCheckSumByte2);


	//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. 

	
} //It shows the error when the cursor comes out of this function.

The error occurs in
void Release() throw()
{
ATLASSERT( nRefs != 0 );
if( _AtlInterlockedDecrement( &nRefs ) <= 0 )
{
pStringMgr->Free( this );
}
}

Anu

AnswerRe: Error in Release() throw function Pin
Andrew Brock2-Feb-11 19:43
Andrew Brock2-Feb-11 19:43 
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 

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.