Click here to Skip to main content
15,923,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Cursor Pos and Font size Pin
«_Superman_»16-Jul-09 4:49
professional«_Superman_»16-Jul-09 4:49 
GeneralRe: Cursor Pos and Font size Pin
susanne116-Jul-09 4:51
susanne116-Jul-09 4:51 
GeneralRe: Cursor Pos and Font size Pin
David Crow16-Jul-09 5:00
David Crow16-Jul-09 5:00 
QuestionOperating System Mutex Pin
Tristan Rhodes16-Jul-09 2:01
Tristan Rhodes16-Jul-09 2:01 
AnswerRe: Operating System Mutex Pin
«_Superman_»16-Jul-09 2:17
professional«_Superman_»16-Jul-09 2:17 
GeneralRe: Operating System Mutex Pin
Tristan Rhodes16-Jul-09 5:05
Tristan Rhodes16-Jul-09 5:05 
AnswerRe: Operating System Mutex Pin
Rajesh R Subramanian16-Jul-09 3:02
professionalRajesh R Subramanian16-Jul-09 3:02 
Questioncall a dialog box in a dll Pin
UserNameless16-Jul-09 1:20
UserNameless16-Jul-09 1:20 
AnswerRe: call a dialog box in a dll Pin
_AnsHUMAN_ 16-Jul-09 1:30
_AnsHUMAN_ 16-Jul-09 1:30 
GeneralRe: call a dialog box in a dll [modified] Pin
UserNameless16-Jul-09 1:33
UserNameless16-Jul-09 1:33 
QuestionDifference Debugging F5 and Ctrl F5 Pin
prithaa16-Jul-09 1:12
prithaa16-Jul-09 1:12 
AnswerRe: Difference Debugging F5 and Ctrl F5 Pin
Maximilien16-Jul-09 1:18
Maximilien16-Jul-09 1:18 
AnswerRe: Difference Debugging F5 and Ctrl F5 Pin
carter200016-Jul-09 1:21
carter200016-Jul-09 1:21 
AnswerRe: Difference Debugging F5 and Ctrl F5 Pin
krmed16-Jul-09 7:18
krmed16-Jul-09 7:18 
GeneralRe: Difference Debugging F5 and Ctrl F5 Pin
prithaa16-Jul-09 18:05
prithaa16-Jul-09 18:05 
QuestionNeed guidance and proposal of design and implementation for an e-voting (electronic voting) system Pin
bahareh65515-Jul-09 23:14
bahareh65515-Jul-09 23:14 
AnswerRe: Need guidance and proposal of design and implementation for an e-voting (electronic voting) system Pin
Stuart Dootson16-Jul-09 0:50
professionalStuart Dootson16-Jul-09 0:50 
QuestionDialog font size problem Pin
DevelopmentNoob15-Jul-09 23:05
DevelopmentNoob15-Jul-09 23:05 
AnswerRe: Dialog font size problem Pin
Michael Schubert15-Jul-09 23:27
Michael Schubert15-Jul-09 23:27 
GeneralRe: Dialog font size problem Pin
DevelopmentNoob16-Jul-09 21:24
DevelopmentNoob16-Jul-09 21:24 
QuestionCreateObject with specific constructor Pin
sangbl15-Jul-09 22:42
sangbl15-Jul-09 22:42 
AnswerRe: CreateObject with specific constructor Pin
Stuart Dootson16-Jul-09 0:46
professionalStuart Dootson16-Jul-09 0:46 
QuestionRe: CreateObject with specific constructor Pin
sangbl16-Jul-09 1:44
sangbl16-Jul-09 1:44 
QuestionANSI to UTF8 (dynamic mem alloc?) Pin
Souldrift15-Jul-09 22:36
Souldrift15-Jul-09 22:36 
Good morning Smile | :) ,

got a question to the following code piece which converts ansi text to UTF8.

void SynthesizerSvox::ANSI2UTF8( char* text, int size, char*& result )
{
	const int SIZE = 10240;

	if( result ) 
	{
		delete [] result;
	}
	result = new char[SIZE];
	
	WCHAR w[SIZE]={0};
	int erg=0;

	erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, SIZE / sizeof(WCHAR));	// ANSI to UNICODE
	erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, result, SIZE, 0, 0);		// UNICODE to UTF-8
}


I found the code somewhere on the net (thanks!) and it works nicely. Only I´d like to work with dynamic memory allocation (don´t like to limit it) and can´t seem to get it done. The number of bytes used per character vary in UTF8 character set.
Is there a solution to this?

Souldrift
AnswerRe: ANSI to UTF8 (dynamic mem alloc?) Pin
CPallini15-Jul-09 22:57
mveCPallini15-Jul-09 22:57 

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.