ws2.dll on PocketPC 2002 ?

  • Thread starter Benjamin Lukner
  • Start date
B

Benjamin Lukner

Hi!

I'm using the ws2.dll in one of my programs and it works fine on PPC
2003 / CE.Net 4.x
On PPC2002 I only get MissingMethodExceptions. The help for WSAStartup
says "requires WinCE 1.0 or later". But where's that DLL gone?


Kind regards,

Benjamin Lukner
 
A

Alex Feinman [MVP]

On Windows CE 3.0 it is in winsock.dll. Good news is that winsock.dll is
present on the CE.NET 4.2 platform (although it simply wraps ws2.dll). Bad
news is that some functions (like WSALookupServiceNext) are only exported
from ws2.dll
 
B

Benjamin Lukner

Alex said:
On Windows CE 3.0 it is in winsock.dll. Good news is that winsock.dll is
present on the CE.NET 4.2 platform (although it simply wraps ws2.dll). Bad
news is that some functions (like WSALookupServiceNext) are only exported
from ws2.dll

Hi!

Using Winsock.dll on PPC2002 works fine, BUT:
- WSAGetLastError throws a MissingMethodException (though the help
says WinCE 1.0+). Where do I find that function?
Private Declare Function WSAGetLastError Lib "winsock.dll" () As Int32

- The supported Winsock Version is v1.1, even on PPC2003. (returned by
WSAStartup in WSADATA) So it can't simply be a wrapper... I'll check the
OS version and use winsock.dll on CE 3.x and ws2.dll on CE 4.x+.


Kind regards,

Benjamin Lukner
 
P

Paul G. Tobey [eMVP]

It *IS* a wrapper (with some extra functions to implement WinSock 2.0).
This declaration in winsock.h should answer your question:

#define WSAGetLastError() GetLastError()

Paul T.
 
B

Benjamin Lukner

Paul said:
It *IS* a wrapper (with some extra functions to implement WinSock 2.0).

But when using Winsock.dll on PPC2003, I still get 1.1 and not 2.2.
That's what I was confused about.
This declaration in winsock.h should answer your question:

#define WSAGetLastError() GetLastError()

mmhh..... OK... The WinCE Winsock.h is installed on another drive here,
so I opened the one from VC7... And of course there is not a single
mentioning of GetLastError() in the whole MSDN help, when you start with
recv() and click through all related links...

Private Declare Function WSAGetLastError Lib "winsock.dll" Alias
"GetLastError" () As Int32

Things can be so easy.
Thank you very much!


Kind regards,

Benjamin Lukner
 
B

Benjamin Lukner

Private Declare Function WSAGetLastError Lib "winsock.dll" Alias
"GetLastError" () As Int32

Private Declare Function WSAGetLastError Lib "CoreDLL.dll" Alias
"GetLastError" () As Int32

....works somewhat better...


Benjamin Lukner
 
P

Paul G. Tobey [eMVP]

Yes, you have to install the PPC SDK, even if you have no intention of
writing any unmanaged code, so that you can debug this type of problem. I'm
glad you've got it working.

Also, on the winsock DLL and the version, winsock.dll provides the 1.1
support. The ws2.dll provides the 2.0 support so, if you are using
winsock.dll, you *will* see 1.1.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top