Click here to Skip to main content
15,896,201 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Open File with default program Pin
Hamid_RT11-May-06 19:03
Hamid_RT11-May-06 19:03 
GeneralRe: Open File with default program Pin
marcogja12-May-06 2:00
marcogja12-May-06 2:00 
GeneralRe: Open File with default program Pin
RicoH12-May-06 4:48
RicoH12-May-06 4:48 
GeneralRe: Open File with default program Pin
marcogja12-May-06 10:50
marcogja12-May-06 10:50 
Questionactivex controls Pin
troythetech11-May-06 12:21
troythetech11-May-06 12:21 
QuestionProblem with grayscale palette Pin
Jim Crafton11-May-06 11:46
Jim Crafton11-May-06 11:46 
AnswerRe: Problem with grayscale palette - SOLVED! Pin
Jim Crafton11-May-06 13:29
Jim Crafton11-May-06 13:29 
QuestionHow To Convert UNICODE to Base64 Pin
benm9999999911-May-06 8:37
benm9999999911-May-06 8:37 
Hi,

I'm looking for a way to convert from a unicode CString (project is in UNICODE) to a Base64 string, so I can send it via XML to a web service.

Not much luck trying to use the ATL functions... maybe someone can see what i'm doing wrong or has a sample that works ? thanks !!!

CString csTest = _T("test123");
DWORD dwLen = csTest.GetLength();
int nDestLen = Base64EncodeGetRequiredLength(dwLen);
LPSTR strEncoded = new CHAR[nDestLen];

Base64Encode((const BYTE*)csTest.AllocSysString(), csTest.GetLength(), strEncoded, &nDestLen);

//strEncoded contains: "dABlAHMAdA==ÍÍýýýýÝÝÝÝÝÝ " after conversion

LPSTR strDecoded = NULL;
int iLen = 0;
Base64Decode(strEncoded, nDestLen, NULL, &iLen);
strDecoded = new CHAR[iLen]; //iLen is 7 at this point
Base64Decode(strEncoded, nDestLen, (BYTE*)strDecoded, &iLen);

//strDecoded contains: "t" after conversion, not the original "test123"
AnswerRe: How To Convert UNICODE to Base64 Pin
led mike11-May-06 10:14
led mike11-May-06 10:14 
GeneralRe: How To Convert UNICODE to Base64 Pin
benm9999999912-May-06 3:31
benm9999999912-May-06 3:31 
GeneralRe: How To Convert UNICODE to Base64 Pin
led mike12-May-06 5:55
led mike12-May-06 5:55 
GeneralRe: How To Convert UNICODE to Base64 Pin
benm9999999915-May-06 7:37
benm9999999915-May-06 7:37 
Question[Message Deleted] Pin
Sachin .S .Potdar11-May-06 8:25
Sachin .S .Potdar11-May-06 8:25 
AnswerRe: RC4 implemantation in VC++ Pin
Chris Losinger11-May-06 8:44
professionalChris Losinger11-May-06 8:44 
AnswerRe: RC4 implemantation in VC++ Pin
ThatsAlok12-May-06 2:03
ThatsAlok12-May-06 2:03 
Questionmsflexgrid Pin
abdoush11-May-06 7:32
abdoush11-May-06 7:32 
QuestionGetting notification of a button being held down Pin
DRHuff11-May-06 7:23
DRHuff11-May-06 7:23 
AnswerRe: Getting notification of a button being held down Pin
Maxwell Chen11-May-06 7:46
Maxwell Chen11-May-06 7:46 
Questionwindow capture Pin
hariramesh11-May-06 5:04
hariramesh11-May-06 5:04 
AnswerRe: window capture Pin
Andy Moore11-May-06 8:33
Andy Moore11-May-06 8:33 
Questionvisual c++ change button code Pin
xcar11-May-06 4:58
xcar11-May-06 4:58 
AnswerRe: visual c++ change button code Pin
toxcct11-May-06 5:00
toxcct11-May-06 5:00 
GeneralRe: visual c++ change button code Pin
Hamid_RT11-May-06 5:11
Hamid_RT11-May-06 5:11 
GeneralRe: visual c++ change button code Pin
toxcct11-May-06 5:14
toxcct11-May-06 5:14 
GeneralRe: visual c++ change button code Pin
Hamid_RT11-May-06 5:36
Hamid_RT11-May-06 5:36 

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.