I try to develop DLL under NET(with C #), these contain a Windows-Form.
The problem is that navision sends this form always in background, this is never active. This happens only in Navision, if I call the DLL from other program, remains the form in the demand reason and is active.
I develop the DLL with VS.NET as class library(COM-Interop).
Help, which wrong I make?.
Code example:
using System;
using System.Runtime.InteropServices;
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface INavisionTest
{
void start();
}
[ClassInterface(ClassInterfaceType.None)]
public class NavisionTest : INavisionTest
{
public NavisionTest()
{
}
public void start()
{
Form f = new Form();
f.Show();
}
}
Comments
I produce a Automation variable in a Codeunit for the .NET-Form and start these for example in EmployeeCard(without Object Designer).
Codeunit:
Employee Form:
Help! Form remains nevertheless in the background!
It functioned not, only if I start the .NET-Form from a Form(example Employee).
It may not be Modal-Form(form.ShowDialog())!