Board index » cppbuilder » Problem with TIdEncoderMime in C++ Builder 2007
Regan Thacker
![]() CBuilder Developer |
Problem with TIdEncoderMime in C++ Builder 20072007-10-10 03:53:25 AM cppbuilder41 I am in the process of migrating code from C++ Builder 6.0 to 2007. I am getting an exception when I try to use TIdEncoderMIME to encode a string. The excpetion complains that the CodingTable is empty. If I add TIdEncoderMIME to the form and use that, the exception goes away and things work fine. However, if I simply create the object and try to use it, I get the exception. In 6.0, I used the following code: String fullencode; TIdBase64Encoder * MimeEncoder = new TIdBase64Encoder(NULL); try { MimeEncoder->Reset(); MimeEncoder->CodeString(origData); fullencode = MimeEncoder->CompletedInput(); } __finally { delete MimeEncoder; } In 2007, I use: TIdEncoderMIME * MimeEncoder = new TIdEncoderMIME(NULL); try { fullencode = MimeEncoder->Encode(origData); } __finally { delete MimeEncoder; } Any ideas on how to get around this? The unit where I am encoding data is not associated with a form. Thank you, Regan |