🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
3 messages
3 total messages Started by Gene Buckle Wed, 04 Jun 2008 21:57
BytesToString()...
#207
Author: Gene Buckle
Date: Wed, 04 Jun 2008 21:57
32 lines
1647 bytes
Ok, given the following code:

void __fastcall TMainForm::ProcessInbound(TIdUDPListenerThread *AThread, TIdBytes *AData, TIdSocketHandle *ABinding) {
    AnsiString foo;
    foo = BytesToString(AData);
    OutputWindow->Lines->Add(foo);

}

Why am I getting this error:

Could not find a match for 'BytesToString(TBytesDynArray *)'

When the prototype in IdGlobals.hpp (which I'm including!) is:

extern PACKAGE AnsiString __fastcall BytesToString(const TIdBytes AValue, const TIdEncoding AEncoding = (TIdEncoding)(0x1))/* overload */;

TIdBytes is defined in IdGlobals.hpp as:

typedef DynamicArray<Byte >  TIdBytes;

Note that the equivalent code works just fine in Delphi.

How can I make BytesToString() work?!

tnx.

g.

-- 
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
Re: BytesToString()...
#209
Author: Remy Lebeau (TeamB)
Date: Thu, 05 Jun 2008 00:53
15 lines
1523 bytes
"Gene Buckle" <geneb@grumble.deltasoft.com> wrote in message 
news:48470fc5@newsgroups.borland.com...

> void __fastcall TMainForm::ProcessInbound(TIdUDPListenerThread *AThread,
> TIdBytes *AData, TIdSocketHandle *ABinding) {

Look at that declaration very carefully.  You have a TIdBytes* pointer, 
which is wrong.  You need to get rid of the '*' symbol:

    void __fastcall TMainForm::ProcessInbound(TIdUDPListenerThread *AThread, 
TIdBytes AData, TIdSocketHandle *ABinding) {


Gambit 
Re: BytesToString()...
#210
Author: Gene Buckle
Date: Thu, 05 Jun 2008 02:36
22 lines
1490 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
> 
> "Gene Buckle" <geneb@grumble.deltasoft.com> wrote in message 
> news:48470fc5@newsgroups.borland.com...
> 
>> void __fastcall TMainForm::ProcessInbound(TIdUDPListenerThread *AThread,
>> TIdBytes *AData, TIdSocketHandle *ABinding) {
> 
> Look at that declaration very carefully.  You have a TIdBytes* pointer, 
> which is wrong.  You need to get rid of the '*' symbol:
> 
>    void __fastcall TMainForm::ProcessInbound(TIdUDPListenerThread *AThread, 
> TIdBytes AData, TIdSocketHandle *ABinding) {
> 

*blinks*

Er...ok.  S'cuse me while I go dig my Dunce cap out of the closet...

tnx.

g.
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