Article View: borland.public.cppbuilder.internet.socket
Article #2536Re: Server Socket DLL again
From: Remy Lebeau (TeamB)
Date: Sat, 18 Mar 2006 23:45
Date: Sat, 18 Mar 2006 23:45
65 lines
3471 bytes
3471 bytes
"Colin B Maharaj" <noreply@myhost.com> wrote in message
news:441C0EC1.7010901@myhost.com...
> I got errors where the compiler included winsock.h and winsock2.h.
> will it be ok for me to edit windows.h and replace winsock with
> winsock2. ( I did this already and it looks ok so far).
> Of course I have winshoes all over the place. This is not really a
> problem per say I can handle it, but is there a viable solution or
> workaround for the deprecated function TWinshoeSocket.Readable;
WinShoes is the (long outdated) predecessor to Indy. You should consider
switching to Indy, which is much more feature-rich over WinShoes. WinShoes
is only good to use for BCB versions that Indy does not support (BCB 4 and
earlier).
> I get lots of errors concerning Trim ambiguity with AnsiStrings and
> WideStrings
That is because Trim() (and other string-related functions) finally received
overloaded versions for WideString in BCB6. The only time you should be
receiving an ambiquity is if you are passing in a char* or wchar_t* string
to Trim(), since both AnsiString and WideString have constructors that
accept those types of string values. To remove the ambiquity, you should
either:
1) don't pass char/wchar_t* strings to Trim() (and other functions with
AnsiString/WideString overloads). Assign the string to an
AnsiString/WideString variable first, so that the compiler can know which
version of Trim() to call
2) if you are only working with Ansi strings, then assign the char* to an
AnsiString variable and then use the AnsiString::Trim() method instead of
the global Trim() function
> File functions ambiguity with int and __int64.
Similar to the Trim() issue above, many int-related functions (IntToStr(),
etc) now have overloaded versions for __int64. You have to assign your
numeric values to an int or __int64 variable so that compiler knows which
one to call.
> Can I typecast my "direct" strings as AnsiString?
Yes, although it would technically be constructing a temporary AnsiString
object, not typecasting the string to act like an AnsiString. For example:
AnsiString s = Trim(AnsiString(mystring));
Or:
AnsiString s = AnsiString(mystring).Trim();
> and typecast my value like 5 to (int)5 ?
Yes, you can do that.
Alternatively, you can use the 'i32' suffix instead, which tells the
compiler that the value must be treated as a 32-bit signed int value:
AnsiString s = IntToStr(5i32);
Gambit
Technical Details
Message-ID:
<441c9b7c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<441b5f81@newsgroups.borland.com> <441bcb93$1@newsgroups.borland.com> <441C0EC1.7010901@myhost.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2526fbecaea5ac24 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <441b5f81@newsgroups.borland.com> <441bcb93$1@newsgroups.borland.com> <441C0EC1.7010901@myhost.com> Subject: Re: Server Socket DLL again Date: Sat, 18 Mar 2006 15:45:57 -0800 Lines: 67 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <441c9b7c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1142725500 68.69.17.41 (18 Mar 2006 15:45:00 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail