Nav 5 + COM

xyliganxyligan Member Posts: 10
I`m trying to connect my grid (C#) to Nav 5, using COM.
To do this, i typed:
public Form1()
{
...
IntPntr hFocus = GetFocus();
_ParentHwnd = hFocus;
}
 protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.Parent = _ParentHwnd;
                return cp;
            }
        }
In NAV:
Create(gird);
grid.show;
All likes good, but after loading dll in first time, after few seconds, i can`t change data value in my grid, controls works fine.
After loading grid form in second and third.. i can`t change data right off.
In another clients of this dll (C# appl) there is no this problem.
How do you think, why this error occurred?

Comments

  • AdrianAkersAdrianAkers Member Posts: 137
    What is the ".show" method actually doing?

    Didn't think you could show a windows form from a COM component in NAV...
  • xyliganxyligan Member Posts: 10
    It simple show() method of windows form in C#.
    But before, i changed form to create it in NAV form, like a parent container.
  • AdrianAkersAdrianAkers Member Posts: 137
    But you might have problems showing the Windows Form called from a COM component. I didn't think this was fully supported but could be wrong... You'd definitely run in to trouble if you were trying to do this on the 3 tier as well...

    http://msdn.microsoft.com/en-us/library/ee909565.aspx
  • xyliganxyligan Member Posts: 10
    I enabled textbox in row.. and saw that focus is escaping from grid..
    i can`t change anything after selecting textbox or checkbox.
Sign In or Register to comment.