Click here to Skip to main content
15,887,915 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WinHTTP Pin
Mark Salsbery20-Jan-07 6:06
Mark Salsbery20-Jan-07 6:06 
QuestionVector iterators Pin
Waldermort19-Jan-07 18:38
Waldermort19-Jan-07 18:38 
AnswerRe: Vector iterators Pin
Christian Graus19-Jan-07 18:43
protectorChristian Graus19-Jan-07 18:43 
GeneralRe: Vector iterators Pin
Waldermort19-Jan-07 19:01
Waldermort19-Jan-07 19:01 
AnswerRe: Vector iterators Pin
John R. Shaw21-Jan-07 0:55
John R. Shaw21-Jan-07 0:55 
QuestionHow to implement BHO Pin
johnalek19-Jan-07 18:30
johnalek19-Jan-07 18:30 
AnswerRe: How to implement BHO Pin
prasad_som20-Jan-07 3:16
prasad_som20-Jan-07 3:16 
Questionhow to convert WCHAR TO string Pin
amitmistry_petlad 19-Jan-07 16:18
amitmistry_petlad 19-Jan-07 16:18 
i am reading a file in win32 now my file data is stored in the WCHAR array buffer
now I want to put this data orderwise in the listview.
for that i need to convert WCHAR to string.
Environment .net(unicode).

the xml file is below.
<xml>
<FILElist>
<listitem type="file" order="1" >
<filename>C:\Documents and Settings\Administrator\Desktop\MediaFiles\TT.wmv</filename>
<Extension> khuntapada </Extension>
<size>494KB </size>
<duration>00:00:38</duration>
<bitrate>103kbps</bitrate>
<type>Windows Media Audio/video file</type>
<modifieddate>12/10/2005 </modifieddate>
<protected>completed/incompleted</protected>
</listitem>

<listitem type="dir" order="2">
<path>C:\Documents and Settings\Administrator\Desktop\MediaFiles </path>
</listitem>

</FILElist>
</xml>





source file

WCHAR szBuff[5000];


hFile=CreateFile ( L"c:\\Encoder_3.XML"
, GENERIC_READ | GENERIC_WRITE
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);

if(hFile == INVALID_HANDLE_VALUE)
{
MessageBox(0,_T("File is not exist"),_T("Create File"),0);
}
else
{
MessageBox(0,_T("File is exist"),_T("Create File"),0);
}
bool bSucced=ReadFile(hFile,&szBuff,5000,&dwRecvLen,NULL);
szBuff[dwRecvLen] = '\0';

size_t len = wcslen(szBuff) * sizeof(WCHAR);
char* tempOutFile = new char[len];
WideCharToMultiByte(CP_ACP,0,szBuff,-1,tempOutFile,(int)len,NULL,NULL);
//std::string str1 = tempOutFile;


QuestionClient Server Application. Pin
Sameerkumar Namdeo19-Jan-07 15:56
Sameerkumar Namdeo19-Jan-07 15:56 
QuestionC++ certification Pin
celllllllll19-Jan-07 13:31
celllllllll19-Jan-07 13:31 
AnswerRe: C++ certification Pin
#realJSOP19-Jan-07 13:42
mve#realJSOP19-Jan-07 13:42 
GeneralRe: C++ certification Pin
Christian Graus19-Jan-07 18:45
protectorChristian Graus19-Jan-07 18:45 
GeneralRe: C++ certification Pin
#realJSOP20-Jan-07 1:05
mve#realJSOP20-Jan-07 1:05 
AnswerRe: C++ certification Pin
Nemanja Trifunovic19-Jan-07 14:12
Nemanja Trifunovic19-Jan-07 14:12 
GeneralRe: C++ certification Pin
celllllllll19-Jan-07 14:16
celllllllll19-Jan-07 14:16 
AnswerRe: C++ certification Pin
Christian Graus19-Jan-07 18:44
protectorChristian Graus19-Jan-07 18:44 
JokeRe: C++ certification Pin
Rajesh R Subramanian19-Jan-07 19:01
professionalRajesh R Subramanian19-Jan-07 19:01 
GeneralRe: C++ certification Pin
Christian Graus19-Jan-07 19:27
protectorChristian Graus19-Jan-07 19:27 
AnswerRe: C++ certification Pin
Waldermort19-Jan-07 19:07
Waldermort19-Jan-07 19:07 
QuestionHandling WM_QUERYENDSESSION message. Pin
oleg6319-Jan-07 9:02
professionaloleg6319-Jan-07 9:02 
AnswerRe: Handling WM_QUERYENDSESSION message. Pin
David Crow19-Jan-07 9:19
David Crow19-Jan-07 9:19 
Questiondivide by 10 problem Pin
IGeorgeI19-Jan-07 8:29
IGeorgeI19-Jan-07 8:29 
AnswerRe: divide by 10 problem Pin
David Crow19-Jan-07 8:48
David Crow19-Jan-07 8:48 
GeneralRe: divide by 10 problem Pin
IGeorgeI19-Jan-07 8:55
IGeorgeI19-Jan-07 8:55 
GeneralRe: divide by 10 problem Pin
David Crow19-Jan-07 9:01
David Crow19-Jan-07 9:01 

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.