Problem occurred ...please help
-
hi all, I have a Method like this:- void CMyprogramDlg::Addcustomers(BSTR bstrParty) { CListBox m_lbParties; _ASSERTE( bstrParty != NULL); m_lbParties.AddString(bstrParty); } But when I compile this,I am getting such a Error:- "error C2664: 'AddString' : cannot convert parameter 1 from 'unsigned short *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast " How do I solve this? If anyone know this please help me.. Thanks in Advance..
-
hi all, I have a Method like this:- void CMyprogramDlg::Addcustomers(BSTR bstrParty) { CListBox m_lbParties; _ASSERTE( bstrParty != NULL); m_lbParties.AddString(bstrParty); } But when I compile this,I am getting such a Error:- "error C2664: 'AddString' : cannot convert parameter 1 from 'unsigned short *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast " How do I solve this? If anyone know this please help me.. Thanks in Advance..
-
hi all, I have a Method like this:- void CMyprogramDlg::Addcustomers(BSTR bstrParty) { CListBox m_lbParties; _ASSERTE( bstrParty != NULL); m_lbParties.AddString(bstrParty); } But when I compile this,I am getting such a Error:- "error C2664: 'AddString' : cannot convert parameter 1 from 'unsigned short *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast " How do I solve this? If anyone know this please help me.. Thanks in Advance..
You could use
CString
to convert fromUNICODE
tochar
string like this:m_lbParties.AddString(CString(bstrParty))
or useWideCharToMultiByte
function. You must also create list box before you callAddString
. Regards, Andrzej MarkowskiMy Latest ArticlesCCustomBitmapButton: An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl: A clone of the Excel tab sheet control.