I have a one class and two modificators, where in "public" function I'm calling CreateThread with address of the ClientThread function which stored in same class, but in "private" modificator.

And i get this error:
Error: cannot pass argument `&this.ClientThread` of type `extern (Windows) uint delegate(void* param)` to parameter `extern (Windows) uint function(void*) @system`.


    public:
        void server_init() {
CreateThread(NULL, 0, &this.ClientThread, cast(PVOID)clientSocket, 0, NULL);
        }

    private:
        extern(Windows)
        DWORD ClientThread(PVOID param) {
            this.log("\nHello from thread\n");
            return 0;
        }

Reply via email to