Problems with EntryPoint of DLL created in C

0

I need to use a DLL created in C in a C # application.

I have followed several forms seen on the internet and I can not use the methods that are supposed to be in the DLL.

When looking for the entrypoints, 4 appear, which are the following.

DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer

Does anyone know how to use the DLL correctly? I think it's made like COM.

I've tried like this.

[DllImport("DLL.dll", EntryPoint = "DllCanUnloadNow")]
    public static extern int IniciarDia();

    static void Main(string[] args)
    {


        Console.WriteLine(IniciarDia());
        Console.ReadLine();
    }

Thanks in advance.

EDIT: I could solve it, I could access the methods of the DLL. I had to register the dll in windows and I could add it as a reference in the project. That way I could use the using file.lib.

I relied on this page link

Greetings.

    
asked by bECkO 13.03.2018 в 15:00
source

2 answers

1

I could solve it, I could access the methods of the DLL. I had to register the dll in windows and I could add it as a reference in the project. That way I could use the using file.lib.

I relied on this page link

Greetings.

    
answered by 19.03.2018 / 17:46
source
0

You can make a call to a class / method of a library registered by objects dynamic from the framework 4.0 in a simplified way against a COM:

Type t = Type.GetTypeFromProgID("Componente.Libreria");
dynamyc obj = Activator.CreateInstance(t);

In this case for a COM component that is signed, exposed, and registered ( namespace in .NET)

answered by 19.03.2018 в 14:39