Winsock instance exception

0

I'm trying to use MSWinSock in C# 2008, but it doen't work.

I keep on getting this Exception:

System.Runtime.InteropServices.COMException (0x80040112): Het maken van een exemplaar van het COM-onderdeel met CLSID {248DD896-BB45-11CF-9ABC-0080C7E7B78D} uit de IClassFactory is mislukt door de volgende fout: 80040112.

I use this as my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using MSWinsockLib;

using Info.Kernel.Logging;

namespace InfoEmu.Kernel.OldSock
{
    public class WinSockListener
    {
        private WinsockClass Winsock;

        private WinsockClass[] Clients = new WinsockClass[1000];

        public WinSockListener(int port)
        {
            try
            {
                Winsock = new WinsockClass();
                Winsock.LocalPort = port;
                Winsock.Listen();
            }
            catch (Exception e)
            {
                Cout.WriteLine("[ERROR!] {0} {1}", Environment.NewLine, e);
            }
        }
    }
}

I've looked for a long time without good solution. Please help.

c#
com

1 Answer

0

0x80040112 CLASS_E_NOTLICENSED "Class is not licensed for use". The error suggests that COM class requires a design-time license. See details here: Licensing ActiveX Controls - Design-Time Licensing. That is you need either a license for this control, or an alternate (and perhaps a better) solution to implement sockets.

answered on Stack Overflow Oct 8, 2013 by Roman R.

User contributions licensed under CC BY-SA 3.0