diff options
author | fcolin | 2007-02-01 13:01:55 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:01:55 +0000 |
commit | 409394e3680053ea329d162f800042e719f66b3a (patch) | |
tree | 1d788bce6eca7a0903beedeb4316670bdc920952 /Bus/Ivy | |
parent | 696f9321abbee611fa6a6d54da488a6eb7666b5a (diff) | |
download | ivy-cplusplus-409394e3680053ea329d162f800042e719f66b3a.zip ivy-cplusplus-409394e3680053ea329d162f800042e719f66b3a.tar.gz ivy-cplusplus-409394e3680053ea329d162f800042e719f66b3a.tar.bz2 ivy-cplusplus-409394e3680053ea329d162f800042e719f66b3a.tar.xz |
Utilisateur : Fcolin Date : 16/06/00 Heure : 10:40 Archivé dans $/Ivy Commentaire: Init dll socket dans DLLMain (vss 2)
Diffstat (limited to 'Bus/Ivy')
-rw-r--r-- | Bus/Ivy/IvyDllMain.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Bus/Ivy/IvyDllMain.cpp b/Bus/Ivy/IvyDllMain.cpp index ac1a854..c49283a 100644 --- a/Bus/Ivy/IvyDllMain.cpp +++ b/Bus/Ivy/IvyDllMain.cpp @@ -12,18 +12,31 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) if (dwReason == DLL_PROCESS_ATTACH)
{
- TRACE("LIBIVY.DLL Initializing!\n");
+ TRACE("IVY.DLL Initializing!\n");
// Extension DLL one-time initialization
- //if (WSAInit)
- // return 0;
+
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD( 2, 2 );
+
+ err = WSAStartup( wVersionRequested, &wsaData );
+ if ( err != 0 ) {
+ /* Tell the user that we could not find a usable */
+ /* WinSock DLL. */
+ return 0;
+ }
+
}
else if (dwReason == DLL_PROCESS_DETACH)
{
- TRACE("LIBIVY.DLL Terminating!\n");
+ TRACE("IVY.DLL Terminating!\n");
// Terminate the library before destructors are called
+ WSACleanup();
}
return 1; // ok
}
|