Board index » cppbuilder » Problem with TIdEncoderMime in C++ Builder 2007

Problem with TIdEncoderMime in C++ Builder 2007


2007-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
 
 

Re:Problem with TIdEncoderMime in C++ Builder 2007

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
Quote
I am in the process of migrating code from C++ Builder 6.0 to 2007.
You did not say which version of Indy you are using.
Quote
I am getting an exception when I try to use TIdEncoderMIME
to encode a string. The excpetion complains that the
CodingTable is empty.
I ran into the same problem awhile back. TIdEncoderMIME's InitComponent()
method was not being called correctly to initialize the CodingTable. I
don't remember why, and I haven't played with it in recent months.
Quote
Any ideas on how to get around this?
Have you tried upgrading to a newer version of Indy yet?
Gambit
 

Re:Problem with TIdEncoderMime in C++ Builder 2007

It is version 10.1.5, the version that comes with C++ Builder 2007 (released
in September).
I have not tried to download the latest as I assumed since C++ Builder 2007
just released, this would be the most current and tested. However, when I
look at the Indy site, I am unable to see any version later than 10.1.5.
I will try to find a later version.
Thanks,
Regan
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
news:470bdc34$ XXXX@XXXXX.COM ...

>I am in the process of migrating code from C++ Builder 6.0 to 2007.

You did not say which version of Indy you are using.

>I am getting an exception when I try to use TIdEncoderMIME
>to encode a string. The excpetion complains that the
>CodingTable is empty.

I ran into the same problem awhile back. TIdEncoderMIME's InitComponent()
method was not being called correctly to initialize the CodingTable. I
don't remember why, and I haven't played with it in recent months.

>Any ideas on how to get around this?

Have you tried upgrading to a newer version of Indy yet?


Gambit


 

{smallsort}

Re:Problem with TIdEncoderMime in C++ Builder 2007

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
Quote
I have not tried to download the latest as I assumed since
C++ Builder 2007 just released, this would be the most
current and tested.
Nope. 10.2.3 is the latest. I've already posted many times why it was not
shipped in 2007.
Quote
However, when I look at the Indy site, I am unable to see
any version later than 10.1.5.
10.2.3 is the current development snapshot.
Gambit
 

Re:Problem with TIdEncoderMime in C++ Builder 2007

I attempted to build the snapshot and am unable to do so. Can you please
tell me how to do so with C++ Builder 2007 (as there are not bpks) or direct
me to a previous post or instructions? The only instructions I can find deal
with Delphi or previous versions of C++ Builder. When I try to adapt them,
it appears I can build IndySystem, but not IndyCore.
Regan
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
news:470cfea8$ XXXX@XXXXX.COM ...

>I have not tried to download the latest as I assumed since
>C++ Builder 2007 just released, this would be the most
>current and tested.

Nope. 10.2.3 is the latest. I've already posted many times why it was
not
shipped in 2007.

>However, when I look at the Indy site, I am unable to see
>any version later than 10.1.5.

10.2.3 is the current development snapshot.


Gambit


 

Re:Problem with TIdEncoderMime in C++ Builder 2007

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
Quote
I attempted to build the snapshot and am unable to do so.
Why not? You need to be more specific.
Quote
The only instructions I can find deal with Delphi or previous
versions of C++ Builder. When I try to adapt them, it appears
I can build IndySystem, but not IndyCore.
Again, why not?
Gambit
 

Re:Problem with TIdEncoderMime in C++ Builder 2007

The instructions I found are at
groups.google.com/group/borland.public.cppbuilder.internet.socket/browse_thread/thread/b44277b84bdb86be/f86e6b103ac5c6ff
1) I created a new Package project and named it IndySystem11 since the C++
Builder 2007 R2 says it is version 11.0.2804.
2) I then opened IndySystem110.dpk from the Lib\System directory of the Indy
download.
3) I added all the listed .pas files to my new package.
4) I set the Build Configuration to Realease and built the package. There
were no errors.
5) I created a new Package project and named it IndyCore11
6) I opened IndyCore110.dpk from the Lib\Core directory of the Indy download
7) I added all the listed .pas files to the new package.
8) I added the path to the Release directory of the IndySystem110 package to
the include and lib paths for the project.
9) I then attempted to build the project.
I get an error "File not found: 'IdGlobal.dcu'. If I do a search on my
harddrive, the only place I see 'IdGlobal.dcu' is in the following
directories: Program Files\Rad Studio\4.0\lib\Indy10, Program Files\Rad
Studio\4.0\lib\Indy9, Program Files\Rad Studio\4.0\lib\debug\Indy10, and
Program Files\Rad Studio\4.0\lib\debug\Indy9
The files in these directories were installed by C++ Builder 7.0 and not
part of the download from Indy, nor part of the output of building
IndySystem (IdGlobal.obj was build, but no dcu).
Do I include these paths?
What do I need to do to get this to build?
Regan
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
news:470fb373$ XXXX@XXXXX.COM ...

>I attempted to build the snapshot and am unable to do so.

Why not? You need to be more specific.

>The only instructions I can find deal with Delphi or previous
>versions of C++ Builder. When I try to adapt them, it appears
>I can build IndySystem, but not IndyCore.

Again, why not?


Gambit


 

Re:Problem with TIdEncoderMime in C++ Builder 2007

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
Quote
5) I created a new Package project and named it IndyCore11
<snip>
I get an error "File not found: 'IdGlobal.dcu'.
Sounds like you forgot to add "IndySystem11" to IndyCore11's list of
Required packages. Make sure to add both "IndySystem11" and "IndyCore11" to
IndyProtocols11's list when you get that far.
The alternative is to not make your own packages at all, but to use BCB's
copy of dcc32.exe to build the original .dpk files directly instead.
Gambit
 

Re:Problem with TIdEncoderMime in C++ Builder 2007

Quote
The alternative is to not make your own packages at all, but to use BCB's
copy of dcc32.exe to build the original .dpk files directly instead.
I tried to use dcc32.exe. It was unable to build the
Lib\System\IndySystem110.dpk as it was missing a IndySystem110.res file. So
I build IndySystem100.dpk and that worked. I then copied the output files
to the Core directory and ran dcc32 against the IndyCore110.dpk and then
repeated that for the IndyProtocol files. (I had no command line arguments
as I did not know what to specify).
Now I have IndySystem100.bpl, dcp, and dcu. I also have the same for
IndyCore and IndyProtocols. I can find the bpls in the C:\Program
Files\CodeGear\RAD Studio\5.0\bin but the dcus and dcps seem to only be
called IndySystem, IndyCore, and IndyProtocols.
If I replace the bpl files in the 5.0\bin directory, I get the following
error when launching eitehr C++ Builder or the exe I have previously
compiled. "The procedure entry pont @Idsyswin32@TIdSysWin32@ could not be
located in the dynamic link library IndySystem100.bpl"
What step am I missing now?
Regan
 

Re:Problem with TIdEncoderMime in C++ Builder 2007

"Regan Thacker" < XXXX@XXXXX.COM >wrote in message
Quote
I had no command line arguments as I did not know what to specify
Look at the FULLC#.BAT scripts to see what command-line parameters are
normally used. The -JPNE flag is particularly important when compiling for
C++
Quote
Now I have IndySystem100.bpl, dcp, and dcu.
Those files are for Delphi, not C++.
Quote
If I replace the bpl files in the 5.0\bin directory, I get the following
error when launching eitehr C++ Builder or the exe I have previously
compiled.
You did not remove the old version of Indy that ships with BCB, and you did
non recompile with the new version.
Gambit