what's mean this error message..? 
Author Message
 what's mean this error message..?

build and compile with EVC++4.0
error message was following

E:\Works-serial comm\?????a\hardware_01\hardware_01Dlg.cpp(77) : error
C2664: 'void __cdecl CString::Format(const unsigned short *,...)' : cannot
convert parameter 1 from 'char [5]' to 'const unsigned short *'Types pointed
to are unrelated; conversion requires reinterpret_cast, C-style cast or
function-style cast

and source coding was following

void CHardware_01Dlg::OnButton1()
{

//-----------------------------------------------------------------
///////////////////////////////////////////////////////////////////

BYTE theResult;

theResult = READ_PORT_UCHAR((PUCHAR)0x204);

//m_edit1 == theResult;

m_edit1.Format("%02X", theResult);  <-- error occured line

UpdateData(false);
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------

Quote:
}

what's mean?
I don't understand.


Sat, 14 May 2005 08:33:40 GMT  
 what's mean this error message..?
It means that the function was expecting a string of double-byte characters,
and you have passed it a string of single-byte characters.
Try
m_edit1.Format(L"%02X",theResult) instead of
m_edit1.Format("%02X",theResult).


Quote:
> build and compile with EVC++4.0
> error message was following

> E:\Works-serial comm\?????a\hardware_01\hardware_01Dlg.cpp(77) : error
> C2664: 'void __cdecl CString::Format(const unsigned short *,...)' : cannot
> convert parameter 1 from 'char [5]' to 'const unsigned short *'Types
pointed
> to are unrelated; conversion requires reinterpret_cast, C-style cast or
> function-style cast

> and source coding was following

> void CHardware_01Dlg::OnButton1()
> {

> //-----------------------------------------------------------------
> ///////////////////////////////////////////////////////////////////

> BYTE theResult;

> theResult = READ_PORT_UCHAR((PUCHAR)0x204);

> //m_edit1 == theResult;

> m_edit1.Format("%02X", theResult);  <-- error occured line

> UpdateData(false);
> ////////////////////////////////////////////////////////////////////
> //------------------------------------------------------------------
> }

> what's mean?
> I don't understand.



Sat, 14 May 2005 08:45:15 GMT  
 what's mean this error message..?
thanks... stephen bye
^^


Quote:
> It means that the function was expecting a string of double-byte
characters,
> and you have passed it a string of single-byte characters.
> Try
> m_edit1.Format(L"%02X",theResult) instead of
> m_edit1.Format("%02X",theResult).



> > build and compile with EVC++4.0
> > error message was following

> > E:\Works-serial comm\?????a\hardware_01\hardware_01Dlg.cpp(77) :
error
> > C2664: 'void __cdecl CString::Format(const unsigned short *,...)' :
cannot
> > convert parameter 1 from 'char [5]' to 'const unsigned short *'Types
> pointed
> > to are unrelated; conversion requires reinterpret_cast, C-style cast or
> > function-style cast

> > and source coding was following

> > void CHardware_01Dlg::OnButton1()
> > {

> > //-----------------------------------------------------------------
> > ///////////////////////////////////////////////////////////////////

> > BYTE theResult;

> > theResult = READ_PORT_UCHAR((PUCHAR)0x204);

> > //m_edit1 == theResult;

> > m_edit1.Format("%02X", theResult);  <-- error occured line

> > UpdateData(false);
> > ////////////////////////////////////////////////////////////////////
> > //------------------------------------------------------------------
> > }

> > what's mean?
> > I don't understand.



Sat, 14 May 2005 09:22:51 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. wat do these error messages mean

2. What does this error message mean

3. What does this error message means?

4. What does this mean? (error message)

5. Q: What does this error message mean ?

6. Meaning of error messages???

7. Q: What does this error message mean ?

8. What does this error message mean?

9. What does this error message mean?

10. what does this error message mean?

11. What does this error message mean

 

 
Powered by phpBB® Forum Software