A few simple things to try which will validate that the encoding/decoding code is working properly on each end. Create a Base64 encoded string in .NET and then pass it to your decode function. You should get back the same result. Do this same test in the C++ code. This will verify that you can properly encode/decode a string in each of the respective languages. Once you verify that you can encode/decode properly, try to encode the same string in .NET and C++ and compare the results, which will be the Base64 encoded string. If the values are not the same, then you know one of the implementations isn't working correctly. Finally, assuming that everything else looks correct, you will need to step through with a debugger (or use Console.Writeline and printf statements) to ensure that the result of the encode is accurately being passed to the decode function (or vice versa). Also, on the C++ side, make sure you are clearing your strings (or char[] if that's what you are using) and make sure that it is being null terminated properly.
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]