🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
2 messages
2 total messages Started by Eddie Shipman Thu, 27 Apr 2006 13:56
Delphi conversion
#597
Author: Eddie Shipman
Date: Thu, 27 Apr 2006 13:56
23 lines
1481 bytes
I have a friend that needs this code converted from Delphi to
BCPP6.

uses ..., MSXML2_TLB, IdBaseComponent, IdCoder, IdCoder3to4, 
IdCoderMIME;

procedure AddBinaryFile(AStream: TStream; oNode: IXMLDOMNode);
var
  oCDataSection: IXMLDOMCDATASection;
  meMIMEEncoder: TIdEncoderMIME;
begin
  meMIMEEncoder := TIdEncoderMIME.Create(nil);
  try
    oCDataSection := oXMLDoc.createCDATASection(meMIMEEncoder.Encode
(AStream, AStream.Size));
  finally
    meMIMEEncoder.Free;
  end;
  oNode.appendChild(oCDataSection);
  oCDataSection := nil;
end;

Does Indy come installed with BCPP6?
Re: Delphi conversion
#598
Author: Remy Lebeau (TeamB)
Date: Thu, 27 Apr 2006 17:07
41 lines
2025 bytes
"Eddie Shipman" <mrbaseball34@No_Spam_gmail.com> wrote in message
news:MPG.1eba898ad1826f2f9897dd@forums.borland.com...

> I have a friend that needs this code converted from Delphi to BCPP6.

    #include "msxml2.h"
    #include "IdBaseComponent.hpp"
    #include "IdCoder.hpp"
    #include "IdCoder3to4.hpp"
    #include "IdCoderMIME.hpp"
    #include <utilcls.h>

    void __fastcall AddBinaryFile(TStream *AStream, IXMLDOMNode *oNode)
    {
        TComInterface<IXMLDOMCDATASection> oCDataSection;
        TComInterface<IXMLDOMNode> oChild;

        TIdEncoderMIME *meMIMEEncoder = new TIdEncoderMIME(NULL);
        try
        {

oXMLDoc->createCDATASection(WideString(meMIMEEncoder->Encode(AStream,
AStream->Size)), &oCDataSection);
        }
        __finally
        {
            delete meMIMEEncoder;
        }

        oNode->appendChild(oCDataSection, &oChild);
    }

> Does Indy come installed with BCPP6?

Indy 8 does.  That is a very old version, though.  You would have to
completely remove it from the computer first in order to upgrade to Indy 9
or higher.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads