Click here to Skip to main content
15,885,925 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: API for changing Language for non-Unicode Programs???? Pin
Nemanja Trifunovic22-Jun-09 6:04
Nemanja Trifunovic22-Jun-09 6:04 
QuestionHow to add data to sorted vector? Pin
alikalik22-Jun-09 1:32
alikalik22-Jun-09 1:32 
AnswerRe: How to add data to sorted vector? Pin
CPallini22-Jun-09 1:55
mveCPallini22-Jun-09 1:55 
AnswerRe: How to add data to sorted vector? Pin
Rajesh R Subramanian22-Jun-09 1:55
professionalRajesh R Subramanian22-Jun-09 1:55 
GeneralRe: How to add data to sorted vector? Pin
alikalik22-Jun-09 2:14
alikalik22-Jun-09 2:14 
AnswerRe: How to add data to sorted vector? Pin
Stuart Dootson22-Jun-09 2:32
professionalStuart Dootson22-Jun-09 2:32 
Questionoverriding CDialog::Create Pin
p_196022-Jun-09 0:03
p_196022-Jun-09 0:03 
AnswerRe: overriding CDialog::Create Pin
«_Superman_»22-Jun-09 0:38
professional«_Superman_»22-Jun-09 0:38 
GeneralRe: overriding CDialog::Create Pin
p_196022-Jun-09 1:01
p_196022-Jun-09 1:01 
GeneralRe: overriding CDialog::Create Pin
Stuart Dootson22-Jun-09 2:36
professionalStuart Dootson22-Jun-09 2:36 
AnswerRe: overriding CDialog::Create Pin
Member 348023222-Jun-09 1:03
Member 348023222-Jun-09 1: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.