Article View: borland.public.cppbuilder.internet.socket
Article #4504Re: Winsock2.h
From: Remy Lebeau (TeamB)
Date: Mon, 31 Jan 2005 23:48
Date: Mon, 31 Jan 2005 23:48
35 lines
2798 bytes
2798 bytes
"Regan Thacker" <no.spam@no.spam.com> wrote in message news:41fec042$1@newsgroups.borland.com... > I am running into the same error. Everything worked fine until I installed Indy9 into BCB6. Indy 9 uses winsock2.h. The native VCL components (and many third-party socket components in general) still use winsock.h instead. > Is there any way to force everything in the project to use the same winsock? No, because the other components have been coded to use winsock.h instead of winsock2.h. You can't make winsock.h magically work like winsock2.h does. Winsock2.h disables winsock.h if winsock2.h is included by the precompiler first, so everything should be ok in that scenerio. However, if winsock.h is included by the precompiler first, then winsock2.h produces duplicate declarations because Microsoft did not write winsock2.h to not redeclare everything that winsock.h already declares. Had Microsoft been smart, they would have had winsock2.h simply include winsock.h and then have winsock2.h declare only the new things that winsock2.h actually adds that winsock.h does not have. But since when does Microsoft actually act smart? They took winsock.h, duplicated everything into winsock2.h, and then had winsock2.h disable winsock.h. Thus winsock2.h does not work properly when winsock.h is included in a project first. I suppose they did that thinking that everyone would simply replace all occurances of winsock.h with winsock2.h and everything would be good, and they would be right in that regard. But apparently, they did not take into account what would happen when the two try to co-exist in the same project together. Then all hell breaks out. Gambit
Technical Details
Message-ID:
<41fec31b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.zanker.org!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41c616c1@newsgroups.borland.com> <41c6212b@newsgroups.borland.com> <41fec042$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6fe2b743d20077af 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: <41c616c1@newsgroups.borland.com> <41c6212b@newsgroups.borland.com> <41fec042$1@newsgroups.borland.com> Subject: Re: Winsock2.h Date: Mon, 31 Jan 2005 15:48:33 -0800 Lines: 37 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: <41fec31b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1107215131 68.69.17.41 (31 Jan 2005 15:45:31 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.zanker.org!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail