Base64Encode
-
Hi I'm using ATL just for one function. Base64Encode. I don't make server or network i want juste Encode a string. I try to make it with an example from CodeProject:
CString sSource = "ToEncode"; int nDestLen = Base64EncodeGetRequiredLength(sSource.GetLength()); CString str64; Base64Encode((const BYTE*)(LPCSTR)sSource, sSource.GetLength(), str64.GetBuffer(nDestLen), &nDestLen); str64.ReleaseBuffer(nDestLen); cout<<(LPCSTR)str64;
It said me Cannot convert CString to LPCSTR one first argument of Base64Encode. I'm working under VS2005. It's the right way to do what i want? Is there a better way, maybe something else than ATL? How to correct this error? Thanks for your answer. Sorry for my poor english i'm not an english-speaking -
Hi I'm using ATL just for one function. Base64Encode. I don't make server or network i want juste Encode a string. I try to make it with an example from CodeProject:
CString sSource = "ToEncode"; int nDestLen = Base64EncodeGetRequiredLength(sSource.GetLength()); CString str64; Base64Encode((const BYTE*)(LPCSTR)sSource, sSource.GetLength(), str64.GetBuffer(nDestLen), &nDestLen); str64.ReleaseBuffer(nDestLen); cout<<(LPCSTR)str64;
It said me Cannot convert CString to LPCSTR one first argument of Base64Encode. I'm working under VS2005. It's the right way to do what i want? Is there a better way, maybe something else than ATL? How to correct this error? Thanks for your answer. Sorry for my poor english i'm not an english-speakinggyzmau wrote:
Is there a better way, maybe something else than ATL?
You can find many places with Base64 code on the internet, e.g. http://www.ruffboy.com/download.htm[^]