C++ Builder/Delphi 2009 and IndyTiburon 10.5.5 error

Hello,
i installing the latest IndyTiburon package r3641.

1.
There are a problem with the genarated header file /core/IdWinsock2.hpp when i will use the components:
[BCC Error] IdWinsock2.hpp(88):E2040
[BCC Error] IdWinsock2.hpp(89):E2040
[BCC Error] IdWinsock2.hpp(90):E2040
[BCC Error] IdWinsock2.hpp(91):E2040

static const Word IPPORT_REGISTERED_MIN = 0x400;
static const Word IPPORT_REGISTERED_MAX = 0xbfff;
static const Word IPPORT_DYNAMIC_MIN = 0xc000;
static const Word IPPORT_DYNAMIC_MAX = 0xffff;

I comment them out ! and it work fine ! 

 But can i get any other Problems ?


2.
I compiled the packages with the ide

I have create an ProjectFile with the following entries:

IndySystem120.bpl   -- runtimePackage  
IndyCore120.bpl         -- runtimePackage
dclIndyCore120.bpl     -- designtimePackage
IndyProtocols120.bpl    -- runtimePackage
dclIndyProtocols120.bpl  -- designtimePackage

Then i must set in all Package Options->Copmiler->Debugger->Assertion to false
otherwise i get runtime error( exception assertion failed ) only with the C++ Builder programs ind Delphi it works fine with Assertion = true.

Is that correct ?

Regards,
  Sascha Michel
0
Sascha
5/15/2009 10:15:14 AM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

5 Replies
1638 Views

Similar Articles

[PageSpeed] 7
Get it on Google Play
Get it on Apple App Store

<Sascha Michel> wrote in message news:117064@forums.codegear.com...

> i installing the latest IndyTiburon package r3641.

The current is snaphost is rev 3646.

> There are a problem with the genarated header file /core/IdWinsock2.hpp 
> when i will use the components:
>
> [BCC Error] IdWinsock2.hpp(88):E2040
> [BCC Error] IdWinsock2.hpp(89):E2040
> [BCC Error] IdWinsock2.hpp(90):E2040
> [BCC Error] IdWinsock2.hpp(91):E2040

What are the COMPLETE error messages?

Also, make sure you do not have winsock.h included elsewhere in your project 
in front of Indy's header files.  Indy uses winsock2.h, which is not 
compatible with winsock.h if winsock.h gets included first.

> static const Word IPPORT_REGISTERED_MIN = 0x400;
> static const Word IPPORT_REGISTERED_MAX = 0xbfff;
> static const Word IPPORT_DYNAMIC_MIN = 0xc000;
> static const Word IPPORT_DYNAMIC_MAX = 0xffff;

In my copy of IdWinsock2.hpp, which I just compiled with the latest 
snapshot, those declarations are on lines 102-105, not on lines 88-91 as you 
have indicated.

> Then i must set in all Package Options->Copmiler->Debugger->Assertion
> to false otherwise i get runtime error( exception assertion failed )

That would indicate a bug in Indy's code.  Which assertion is being raised 
exactly?

-- 
Remy Lebeau (TeamB)
0
Remy
5/18/2009 6:54:45 PM
OK  Thanks
I download the newest release R646

Now it runs with Assertion = true

but the IdWinsock2.hpp have an error again.

Here it is the complete generatet header File 

// CodeGear C++Builder
// Copyright (c) 1995, 2008 by CodeGear
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Idwinsock2.pas' rev: 20.00

#ifndef Idwinsock2HPP
#define Idwinsock2HPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Idexception.hpp>	// Pascal unit
#include <Idglobal.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------
#include <winsock2.h>
#include <ws2tcpip.h>
#include <wsipx.h>
#include <wsnwlink.h>
#include <wsnetbs.h>
#include <ws2atm.h>
#include <mswsock.h>

namespace Idwinsock2
{
    typedef fd_set *PFDSet;
    typedef fd_set TFDSet;
}


namespace Idwinsock2
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS EIdWinsockStubError;
#pragma pack(push,1)
class PASCALIMPLEMENTATION EIdWinsockStubError : public Idexception::EIdException
{
	typedef Idexception::EIdException inherited;
	
protected:
	unsigned FWin32Error;
	System::UnicodeString FWin32ErrorMessage;
	System::UnicodeString FTitle;
	
public:
	__fastcall EIdWinsockStubError(unsigned AWin32Error, const System::UnicodeString ATitle, System::TVarRec *AArgs, const int AArgs_Size);
	__property unsigned Win32Error = {read=FWin32Error, nodefault};
	__property System::UnicodeString Win32ErrorMessage = {read=FWin32ErrorMessage};
	__property System::UnicodeString Title = {read=FTitle};
public:
	/* EIdException.Create */ inline __fastcall virtual EIdWinsockStubError(const System::UnicodeString AMsg)/* overload */ : Idexception::EIdException(AMsg) { }
	
public:
	/* Exception.CreateFmt */ inline __fastcall EIdWinsockStubError(const System::UnicodeString Msg, System::TVarRec const *Args, const int Args_Size) : Idexception::EIdException(Msg, Args, Args_Size) { }
	/* Exception.CreateRes */ inline __fastcall EIdWinsockStubError(int Ident)/* overload */ : Idexception::EIdException(Ident) { }
	/* Exception.CreateResFmt */ inline __fastcall EIdWinsockStubError(int Ident, System::TVarRec const *Args, const int Args_Size)/* overload */ : Idexception::EIdException(Ident, Args, Args_Size) { }
	/* Exception.CreateHelp */ inline __fastcall EIdWinsockStubError(const System::UnicodeString Msg, int AHelpContext) : Idexception::EIdException(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ inline __fastcall EIdWinsockStubError(const System::UnicodeString Msg, System::TVarRec const *Args, const int Args_Size, int AHelpContext) : Idexception::EIdException(Msg, Args, Args_Size, AHelpContext) { }
	/* Exception.CreateResHelp */ inline __fastcall EIdWinsockStubError(int Ident, int AHelpContext)/* overload */ : Idexception::EIdException(Ident, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ inline __fastcall EIdWinsockStubError(System::PResStringRec ResStringRec, System::TVarRec const *Args, const int Args_Size, int AHelpContext)/* overload */ : Idexception::EIdException(ResStringRec, Args, Args_Size, AHelpContext) { }
	/* Exception.Destroy */ inline __fastcall virtual ~EIdWinsockStubError(void) { }
	
};

#pragma pack(pop)

#pragma pack(push,1)
struct WSACOMPLETION_EVENT
{
	
public:
	_OVERLAPPED *lpOverlapped;
};
#pragma pack(pop)


//-- var, const, procedure ---------------------------------------------------
#define WINSOCK2_DLL L"WS2_32.DLL"
#define MSWSOCK_DLL L"MSWSOCK.DLL"
/*
static const Word IPPORT_REGISTERED_MIN = 0x400;
static const Word IPPORT_REGISTERED_MAX = 0xbfff;
static const Word IPPORT_DYNAMIC_MIN = 0xc000;
static const Word IPPORT_DYNAMIC_MAX = 0xffff;
*/
extern PACKAGE unsigned __fastcall WinsockHandle(void);
extern PACKAGE bool __fastcall Winsock2Loaded(void);

}	/* namespace Idwinsock2 */
using namespace Idwinsock2;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Idwinsock2HPP
0
Sascha
5/19/2009 10:31:00 AM
<Sascha Michel> wrote in message news:118314@forums.codegear.com...

> but the IdWinsock2.hpp have an error again.

Which is what exactly?

-- 
Remy Lebeau (TeamB)
0
Remy
5/19/2009 4:49:09 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> <Sascha Michel> wrote in message news:118314@forums.codegear.com...
> 
> > but the IdWinsock2.hpp have an error again.
> 

[BCC32 Error] Idwinsock2.hpp(87): E2040 Declaration terminated incorrectly
[BCC32 Error] Idwinsock2.hpp(88): E2040 Declaration terminated incorrectly
[BCC32 Error] Idwinsock2.hpp(89): E2040 Declaration terminated incorrectly
[BCC32 Error] Idwinsock2.hpp(90): E2040 Declaration terminated incorrectly

line 87: static const Word IPPORT_REGISTERED_MIN = 0x400;
line 88: static const Word IPPORT_REGISTERED_MAX = 0xbfff;
line 89: static const Word IPPORT_DYNAMIC_MIN = 0xc000;
line 90: static const Word IPPORT_DYNAMIC_MAX = 0xffff;

The error occurs because these four constants are declared as macros in 
ws2def.h:

/*
 * Ports < IPPORT_RESERVED are reserved for
 * privileged processes (e.g. root).
 */
#define IPPORT_RESERVED         1024
#if (_WIN32_WINNT >= 0x0600)
#define IPPORT_REGISTERED_MIN   IPPORT_RESERVED
#define IPPORT_REGISTERED_MAX   0xbfff
#define IPPORT_DYNAMIC_MIN      0xc000
#define IPPORT_DYNAMIC_MAX      0xffff
#endif //(_WIN32_WINNT >= 0x0600)

Edited by: Antonio Estevez on May 19, 2009 2:18 PM
0
Antonio
5/19/2009 9:19:15 PM
<Antonio Estevez> wrote in message news:118547@forums.codegear.com...

> The error occurs because these four constants are declared as
> macros in ws2def.h:

I do not have ws2def.h so I could not verify that, but I suspected that was 
what was going on.

-- 
Remy Lebeau (TeamB)
0
Remy
5/19/2009 10:14:21 PM
Reply:

Web resources about - C++ Builder/Delphi 2009 and IndyTiburon 10.5.5 error - embarcadero.delphi.winsock

Resources last updated: 12/27/2015 3:52:20 PM