Pages: 1
Print
Author Topic: Interop Events  (Read 2505 times)
Stefan.Giehler
Member

Posts: 1


« on: September 03, 2009, 12:26:20 AM »

Hello,

i've got the following Problem:
I use the .net Framwork to create macro-like programs, but when i try to handle XMetal 5.5 events in my application via Interop it fails. Nothing happens.

I tried the following code:
Code:
public partial class Form1 : Form
{
    private XMetaL.ApplicationClass xmIn;
    private XMetaL.ApplicationEvents_SelectionChangedEventHandler handler;
    public Form1()
    {
        InitializeComponent();
        xmIn = new XMetaL.ApplicationClass();
    }

    void xmIn_SelectionChanged()
    {
        MessageBox.Show("bla");
    }

    private void Form1_Load(object sender, EventArgs e)
    {
       
        xmIn.Visible = true;
        handler = new XMetaL.ApplicationEvents_SelectionChangedEventHandler(xmIn_SelectionChanged);
        xmIn.SelectionChanged += handler;
        xmIn.Selection.MoveDown(XMetaL.SQMovementType.sqMove);
    }
}

Thank you for your help,
Stefan
Logged
Pages: 1
Print
Jump to: