A
A
alex_ak12018-02-08 14:12:50
ActiveX
alex_ak1, 2018-02-08 14:12:50

Why can't I generate a tlb from a c# project?

I want to make a library in c #, which can be obtained via COM-OLE.
There is a library, if you open the dll, then there is an interface and implementation, and if you do tlbexp or regasm / tlb, then an empty tlb file is formed, from which headers for c ++ are not obtained (it is also empty). What am I doing wrong?

import...;
namespace mycls1
{
    [ComVisible(true)]
    [Guid("5465C4CC-02E6-4b37-A7C4-DF316021A30E")]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IMyCls1
    {
        int doCalc();
    } 

    [Guid("BD4FC53F-E66D-49e1-A66D-C3D8EBD5A387")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComVisible(true)]
    [ProgId("mycls1.myint1")]
    public class MyCls1Impl : IMyCls1
    {
        [ComVisible(true)]
        public int doCalc()
        {
            return 5;
        }

        public MyCls1Impl()
        {
        }
    }
}

In assembly settings [assembly: ComVisible(true)]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tex0, 2018-02-08
@tex0

here it is written step by step (although there are studios 2003-2005, but the point is not in them, I think you will figure it out)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question