Click here to Skip to main content
15,905,504 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPlease help and need advice. Pin
FISH7867-Mar-09 3:43
FISH7867-Mar-09 3:43 
AnswerRe: Please help and need advice. Pin
«_Superman_»7-Mar-09 14:16
professional«_Superman_»7-Mar-09 14:16 
GeneralRe: Please help and need advice. Pin
FISH7867-Mar-09 14:32
FISH7867-Mar-09 14:32 
GeneralRe: Please help and need advice. Pin
«_Superman_»7-Mar-09 14:38
professional«_Superman_»7-Mar-09 14:38 
GeneralRe: Please help and need advice. Pin
FISH7867-Mar-09 15:15
FISH7867-Mar-09 15:15 
QuestionDisplaying Chinese character. Pin
gothic_coder7-Mar-09 2:56
gothic_coder7-Mar-09 2:56 
AnswerRe: Displaying Chinese character. Pin
Code-o-mat7-Mar-09 3:26
Code-o-mat7-Mar-09 3:26 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 3:46
gothic_coder7-Mar-09 3:46 
This is what i'm doing...
_bstr_t bstrString_Ini;
 _bstr_t bstrString_Tag;
 _bstr_t bstrString_Dest;
 char sqlQuery[2 * MAX_PATH] = "";
 sprintf(sqlQuery, "SELECT IniSection,TagName,DestinationValue FROM %s WHERE FileName = '%s'" , szTableName, szstr);
 _bstr_t sqlQueryText(sqlQuery);

 try
 {
     ADODB::_CommandPtr m_objCmdSearch;
     ADODB::_RecordsetPtr m_cpRecordsetSearch;

     //Create instance of command object
     HRESULT hr = m_objCmdSearch.CreateInstance("ADODB.Command");
     if(SUCCEEDED(hr))
     {
         //Set the active connection property of command object to open connection
         m_objCmdSearch->ActiveConnection = m_cpConnection;

         //Set command object's command type to text
         m_objCmdSearch->CommandType = ADODB::adCmdText;

         //Set Command Text
         m_objCmdSearch->CommandText = sqlQueryText;

         //Execute command and get results in Recordset object
         m_cpRecordsetSearch = m_objCmdSearch->Execute(NULL, NULL, ADODB::adCmdText);
         if(m_cpRecordsetSearch != NULL)
         {
             if(!m_cpRecordsetSearch->GetEndOfFile())
             {
                 char szstr[MAX_PATH];
                 char szstr1[MAX_PATH];

                 m_cpRecordsetSearch->MoveFirst();

                 while(!m_cpRecordsetSearch->EndOfFile)
                 {
                     bstrString_Ini = m_cpRecordsetSearch->Fields->GetItem("IniSection")->GetValue().bstrVal;
                     bstrString_Tag = m_cpRecordsetSearch->Fields->GetItem("TagName")->GetValue().bstrVal;
                     bstrString_Dest = m_cpRecordsetSearch->Fields->GetItem("DestinationValue")->GetValue().bstrVal;

                     m_cpRecordsetSearch->MoveNext();
                 }


                 rVal = TRUE;
             }

             if((m_cpRecordsetSearch->State &  ADODB::adStateOpen) != 0)
             {
                 m_cpRecordsetSearch->Close();
                 m_cpRecordsetSearch = NULL;
             }
         }

         m_objCmdSearch->PutRefActiveConnection(NULL);
     }
 }



And i get "Abc ????" in bstrString_Dest... Which is defined as _bstr_t...
bstrString_Dest = cpRecordsetSearch->Fields->GetItem("DestinationValue")->GetValue().bstrVal;


What else do i need to do.. I've enabled unicode in my project..
GeneralRe: Displaying Chinese character. Pin
Code-o-mat7-Mar-09 4:05
Code-o-mat7-Mar-09 4:05 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 4:09
gothic_coder7-Mar-09 4:09 
GeneralRe: Displaying Chinese character. Pin
Code-o-mat7-Mar-09 4:30
Code-o-mat7-Mar-09 4:30 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 4:50
gothic_coder7-Mar-09 4:50 
GeneralRe: Displaying Chinese character. Pin
Code-o-mat7-Mar-09 7:53
Code-o-mat7-Mar-09 7:53 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 7:58
gothic_coder7-Mar-09 7:58 
GeneralRe: Displaying Chinese character. Pin
Code-o-mat7-Mar-09 8:05
Code-o-mat7-Mar-09 8:05 
AnswerRe: Displaying Chinese character. Pin
«_Superman_»7-Mar-09 14:03
professional«_Superman_»7-Mar-09 14:03 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 19:38
gothic_coder7-Mar-09 19:38 
GeneralRe: Displaying Chinese character. Pin
«_Superman_»7-Mar-09 19:56
professional«_Superman_»7-Mar-09 19:56 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 21:33
gothic_coder7-Mar-09 21:33 
GeneralRe: Displaying Chinese character. Pin
gothic_coder8-Mar-09 23:56
gothic_coder8-Mar-09 23:56 
GeneralRe: Displaying Chinese character. Pin
«_Superman_»8-Mar-09 23:59
professional«_Superman_»8-Mar-09 23:59 
GeneralRe: Displaying Chinese character. Pin
gothic_coder9-Mar-09 0:39
gothic_coder9-Mar-09 0:39 
General[Message Deleted] Pin
gothic_coder9-Mar-09 0:41
gothic_coder9-Mar-09 0:41 
GeneralRe: Displaying Chinese character. Pin
«_Superman_»9-Mar-09 0:47
professional«_Superman_»9-Mar-09 0:47 
GeneralRe: Displaying Chinese character. Pin
gothic_coder9-Mar-09 1:04
gothic_coder9-Mar-09 1:04 

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.