Article View: borland.public.cppbuilder.internet.socket
Article #368Re: Safe to modify machine-generated headers?
From: Remy Lebeau (TeamB)
Date: Wed, 26 Mar 2008 23:19
Date: Wed, 26 Mar 2008 23:19
35 lines
2567 bytes
2567 bytes
"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:
<47eada16@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!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<47eacf28$1@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 From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <47eacf28$1@newsgroups.borland.com> Subject: Re: Safe to modify machine-generated headers? Date: Wed, 26 Mar 2008 16:19:41 -0700 Lines: 37 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 207.178.157.90 Message-ID: <47eada16@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1206573590 207.178.157.90 (26 Mar 2008 16:19:50 -0700) 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!news.isoc.lu!newsgroups.borland.com!not-for-mail