ConnectEx() - Bezeichner nicht gefunden.



  • Hi,

    Ich lerne gerade über AcceptEx() und ConnectEx() (Mswsock.h) und habe eben versucht eine Testapplikation mit ConnectEx zu schreiben. Doch wie ich leider feststellen muss ist ConnectEx() nicht erkannt worden.

    #include <stdio.h>
    #include <stdlib.h>
    //#define WIN32_LEAN_AND_MEAN
    #include <winsock2.h>
    #include <Mstcpip.h>
    #include <Mswsock.h>
    #include <windows.h>
    
    #pragma comment (lib, "Mswsock.lib")
    #pragma comment (lib, "ws2_32.lib")
    
    ...
    
    error C3861: "ConnectEx": Bezeichner wurde nicht gefunden.
    


  • The function pointer for the ConnectEx function must be obtained at run time by making a call to the WSAIoctl function with the SIO_GET_EXTENSION_FUNCTION_POINTER opcode specified.

    Ich weiß für AcceptEx steht das auch so in der Hilfe obwohl es dafür ne Deklaration gibt, aber bei ConnectEx wurde sie wohl weggelassen.



  • Warum ist das eigentlich so? Was ist der Unterschied?



  • http://www.codeproject.com/KB/IP/jbsocketserver3.aspx

    Several of the extension functions have been available since WinSock 1.1 and are exported from MSWsock.dll, however it's not advisable to link directly to this dll as this ties you to the Microsoft WinSock provider. A provider neutral way of accessing these extension functions is to load them dynamically via WSAIoctl using the SIO_GET_EXTENSION_FUNCTION_POINTER op code. This should, theoretically, allow you to access these functions from any provider that supports them...


Anmelden zum Antworten