Options

.NET-Form for Navision

f.ritzf.ritz Member Posts: 13
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

  • Options
    Kenny_VaesKenny_Vaes Member Posts: 8
    I had this too, but only when the Object Designer was open. Try runnig it from the menusuite or close the Object Designer each time ;)
  • Options
    f.ritzf.ritz Member Posts: 13
    It does not function!
    I produce a Automation variable in a Codeunit for the .NET-Form and start these for example in EmployeeCard(without Object Designer).

    Codeunit:
    define nav_test as Automation(NavisionTest)
    --OnRun()------------------
    CREATE(nav_test);
    nav_test.start();
    -----------------------------
    

    Employee Form:
    define codeu as codeunit(Codeunitname)
    --<Button> - OnPush()-----
    codeu.RUN();
    --------------------------------
    

    Help! Form remains nevertheless in the background!
  • Options
    f.ritzf.ritz Member Posts: 13
    I do not have problems if the Object designer is closed or I start the .NET-Form from Menusuite.

    It functioned not, only if I start the .NET-Form from a Form(example Employee).

    It may not be Modal-Form(form.ShowDialog())!
Sign In or Register to comment.