Click here to Skip to main content
15,892,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8322-Jun-09 11:28
Ivan Ivanov 8322-Jun-09 11:28 
AnswerRe: Performance problem with my FindOneOf function Pin
Roger Stoltz22-Jun-09 9:22
Roger Stoltz22-Jun-09 9:22 
GeneralRe: Performance problem with my FindOneOf function Pin
Ivan Ivanov 8322-Jun-09 10:59
Ivan Ivanov 8322-Jun-09 10:59 
GeneralRe: Performance problem with my FindOneOf function Pin
Roger Stoltz22-Jun-09 21:39
Roger Stoltz22-Jun-09 21:39 
GeneralRe: Performance problem with my FindOneOf function [modified] Pin
Ivan Ivanov 8324-Jun-09 1:45
Ivan Ivanov 8324-Jun-09 1:45 
GeneralRe: Performance problem with my FindOneOf function Pin
Roger Stoltz24-Jun-09 4:16
Roger Stoltz24-Jun-09 4:16 
GeneralRe: Performance problem with my FindOneOf function [modified] Pin
Ivan Ivanov 8325-Jun-09 1:25
Ivan Ivanov 8325-Jun-09 1:25 
QuestionXMLHTTP post failed with status code 415 Pin
Ash_VCPP22-Jun-09 3:47
Ash_VCPP22-Jun-09 3:47 
AnswerRe: XMLHTTP post failed with status code 415 Pin
KarstenK22-Jun-09 4:15
mveKarstenK22-Jun-09 4:15 
QuestionTimer on Statusbar Pin
susanne122-Jun-09 3:10
susanne122-Jun-09 3:10 
AnswerRe: Timer on Statusbar Pin
Rajesh R Subramanian22-Jun-09 3:25
professionalRajesh R Subramanian22-Jun-09 3:25 
AnswerRe: Timer on Statusbar Pin
David Crow22-Jun-09 4:05
David Crow22-Jun-09 4:05 
QuestionHow to access element in Multiset by index Pin
alikalik22-Jun-09 3:05
alikalik22-Jun-09 3:05 
AnswerRe: How to access element in Multiset by index Pin
Chris Losinger22-Jun-09 3:13
professionalChris Losinger22-Jun-09 3:13 
GeneralRe: How to access element in Multiset by index Pin
alikalik22-Jun-09 3:30
alikalik22-Jun-09 3:30 
AnswerRe: How to access element in Multiset by index Pin
Sarath C22-Jun-09 3:20
Sarath C22-Jun-09 3:20 
Questionsplit wavefiles programetically Pin
N Vamshi Krishna22-Jun-09 3:04
N Vamshi Krishna22-Jun-09 3:04 
AnswerRe: split wavefiles programetically Pin
Rozis23-Jun-09 6:42
Rozis23-Jun-09 6:42 
QuestionPlease clarify my doubt.... Pin
Rakesh522-Jun-09 2:25
Rakesh522-Jun-09 2:25 
Hi,
I am new to development world...

I am actually converting my application to unicode supporting one.. i have a problem like this..

Requirement :

I should view both ASCII encoded files and UNICODE encoded files..

Scenario:

The following code snippet was used to convert to wide characters after reading content from file.. this code works fine with ASCII encoded files but doesnt work fine if i try to view unicode encoded file. the prob. lies in the last line...(Buffer->Txt = Buf) since MultiByteToWideChar(CP_ACP, 0,(LPCSTR)Buffer->Txt, -1, (LPWSTR)Buf, nBuflength); returns some junk value to Buf....
...

My Doubt is this:

I Observed keenly that whenever i try to upload unicode fille, nBuflength will be 4 and for ascii it will be 529273(not sure abt this value).. i have used an if statement here to make it work...

is it a hard-coded one??

Code Snippet:

Buffer is a structure object and Txt is a WCHAR* type.


wchar_t *Buf = NULL ;
int nBuflength = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)Buffer->Txt, -1, (LPWSTR)Buf, 0);
Buf = new wchar_t[nBuflength];

if( (nnBuflength/2) != sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0,(LPCSTR)Buffer->Txt, -1, (LPWSTR)Buf, nBufLen);
Buffer->Txt = Buf;
}
else
------------------


Can we do in any other way to achieve my objective or is this a final one??

plss help me...

Thanks,
Rakesh.

Rakesh S
AnswerRe: Please clarify my doubt.... Pin
Stuart Dootson22-Jun-09 2:42
professionalStuart Dootson22-Jun-09 2:42 
QuestionAPI for changing Language for non-Unicode Programs???? Pin
Super Hornet22-Jun-09 1:39
Super Hornet22-Jun-09 1:39 
AnswerRe: API for changing Language for non-Unicode Programs???? Pin
Rajesh R Subramanian22-Jun-09 1:46
professionalRajesh R Subramanian22-Jun-09 1:46 
QuestionRe: API for changing Language for non-Unicode Programs???? Pin
Super Hornet22-Jun-09 1:50
Super Hornet22-Jun-09 1:50 
AnswerRe: API for changing Language for non-Unicode Programs???? Pin
Rajesh R Subramanian22-Jun-09 1:59
professionalRajesh R Subramanian22-Jun-09 1:59 
GeneralRe: API for changing Language for non-Unicode Programs???? Pin
Super Hornet22-Jun-09 2:03
Super Hornet22-Jun-09 2:03 

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.