S
S
Space Purr2019-05-15 15:53:24
WPF
Space Purr, 2019-05-15 15:53:24

How to create an ActiveX library in c# using WPF?

Hello.
You need to create an ActiveX library that will be built into another platform.
I am creating a .dll library project in VisualStudio.
There I create a UserControl, which I redefine under Window, according to the instructions, as for a regular class, I do it like Com

[ProgId("MyActiveX.MainWindow")]

    [ClassInterface(ClassInterfaceType.AutoDual)]

    [Guid("0BE4662C-3B92-40CB-A4FA-E818AAB3419B")]

    [ComVisible(true)]
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }

AssemblyInfo also has ComVisible set to true.
I compile, register the library through regasm.
When registering, a lot of errors come up with the following description:
Type library exporter warning when processing "MyActiveX.MainWindow.InputHitTest(point), MyActiveX". Warning: The currently exported type, or one of its base types, refers to a non-COM-mapped value type "System.Windows.Point".
I have no experience in this matter at all, for the first time I create such a library, as far as I understand with WPF in this regard, everything is not so simple at all.
I will be glad to help.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid, 2019-05-15
@SpacePurr

well, there is no such type in System.Windows.Point = this is a dotnet type. you must describe such a class yourself and publish it as well. And another platform should be able to pull up .NET for such an activation. Or write it not in .NET but in something native - for example Delphi or C ++

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question