Why can't Indy 10 initialize?
I have a problem with a Delphi 2009 project : It can't initialize Indy 10 !
This code worked fine before in Delphi 2007 (although we might have been using an older revision of Indy, but I suspect that has not much to do with it);

The initial call to IdWinsock2.InitializeWinSock(), raises this exception (with error code 998) :

    Project EAServer.exe raised exception class EIdWinsockStubError with message
    'Error on loading Winsock2 library (WS2\_32.DLL): Invalid access to memory location'.

But ws2\_32.dll is in C:\Windows\System32 allright, with these version details :

    File Version : 5.1.2600.5512 (xpsp.080413-0852)
    Description : Windows Socket 2.0 32-Bit DLL
    Copyright : © Microsoft Corporation. All rights reserved.
(this shows I'm on WinXP btw).


The silly thing is, that when I look at the process itself (using "Process Explorer"), I can see the process already has this DLL open. The reason "WS2\_32.DLL" is already loaded, seems to be because we use the RTL unit Winsock.pas in this project too.
This unit is statically linked to "wsock32.dll", which has a dependancy on WS2\_32.DLL, so there.

Does anyone know why this code worked fine before (in Delphi 2007), and now (in Delphi 2009) it suddenly breaks?


And is this inability to re-open the ws2\_32 dll common knowledge, or is there really something wrong here? (I did check : I only have 1 version of these DLL's present on my system).


Better yet : Can anyone help me fixing this?





Why can't Indy 10 initialize?
===

I have a problem with a Delphi 2009 project : It can't initialize Indy 10 !
This code worked fine before in Delphi 2007 (although we might have been using an older revision of Indy, but I suspect that has not much to do with it);

The initial call to IdWinsock2.InitializeWinSock(), raises this exception (with error code 998) :

    Project EAServer.exe raised exception class EIdWinsockStubError with message
    'Error on loading Winsock2 library (WS2\_32.DLL): Invalid access to memory location'.

But ws2\_32.dll is in C:\Windows\System32 allright, with these version details :

    File Version : 5.1.2600.5512 (xpsp.080413-0852)
    Description : Windows Socket 2.0 32-Bit DLL
    Copyright : © Microsoft Corporation. All rights reserved.
(this shows I'm on WinXP btw).


The silly thing is, that when I look at the process itself (using "Process Explorer"), I can see the process already has this DLL open. The reason "WS2\_32.DLL" is already loaded, seems to be because we use the RTL unit Winsock.pas in this project too.
This unit is statically linked to "wsock32.dll", which has a dependancy on WS2\_32.DLL, so there.

Does anyone know why this code worked fine before (in Delphi 2007), and now (in Delphi 2009) it suddenly breaks?


And is this inability to re-open the ws2\_32 dll common knowledge, or is there really something wrong here? (I did check : I only have 1 version of these DLL's present on my system).


Better yet : Can anyone help me fixing this?




