Article View: borland.public.cppbuilder.internet.socket
Article #369Re: Safe to modify machine-generated headers?
From: Mike K
Date: Thu, 27 Mar 2008 04:02
Date: Thu, 27 Mar 2008 04:02
43 lines
2801 bytes
2801 bytes
Actually, you're right; I have Indy components installed and I will use them instead - it's just for this one application anyway. thanks... Remy Lebeau (TeamB) wrote: > "Mike K" <nospam@nospam.net> wrote in message > news:47eacf28$1@newsgroups.borland.com... > >> I also need to open a standard TServerSocket to open a pipe >> to another application. As soon as I drop this component onto >> the form, the compiler complains about a multiple declaration >> for 'fd_set', which is defined in both winsock.h and winsock2.h. > > winsock.h and winsock2.h do not coexist together. That is Microsoft's > mistake. They copied all of winsock.h's data structures and macros into > winsock2.h, instead of having winsock2.h simply #include winsock.h for them > instead. I do not know why they did that, but it is a real pain to get > around, and doubly so since you are involving the VCL. > > Basically, you need to separate your winsock2.h-based code from your > winsock.h-based code. Put them into completely separate units so the two > headers have no chance of colliding with each other. Better if you can move > one of them into a completely separate project, such as a static .lib that > you can then include into the main application once compiled. > >> Can I modify WinSock.hpp to call winsock2.h instead of winsock.h > > I would not recommend that. > >> For various reasons, I'd like to have (int the same application) the use >> of both my standard Borland socket components and the WinPcap >> library as well. > > Do you have the option of using different TCP components? Indy, for > instance, uses winsock2.h instead of winsock.h. You may want to consider a > change anyway, since TServerSocket and TClientSocket are deprecated now. > > > Gambit > >
Technical Details
Message-ID:
<47eb1c51$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47eacf28$1@newsgroups.borland.com> <47eada16@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c924a16d59a4cb70 X-Google-Attributes: gid11508e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 26 Mar 2008 23:02:27 -0500 From: Mike K <nospam@nospam.net> User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Safe to modify machine-generated headers? References: <47eacf28$1@newsgroups.borland.com> <47eada16@newsgroups.borland.com> In-Reply-To: <47eada16@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 74.36.61.84 Message-ID: <47eb1c51$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1206590545 74.36.61.84 (26 Mar 2008 21:02:25 -0700) Lines: 43 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail