Embed OCX in Navision Form

Hi all, id like to embed an OCX Control in a Navision Form. e.g. You can use Internet Explorer directly from Sales Header. Does anybody know how to embed OCX Objects in a form ? Is it possible to do something like that with .NET ? Thx for any help Regards Karsten P.S. It should look like this http://www16.brinkster.com/moonlightkr/picture.htm

Hi I was thinking of an easier and quicker way, but may be depends on what exactly you want. You can do a command button or menu item with a PushAction property set to RunSystem, and specify the file location (and in this case it is static) in the RunCommand property. e.g. use :\Program Files\Internet Explorer\IExplore.exe for running Internet explorer from Navision. Robert

Thank you for your suggestion. But it would call Internet Explorer from Navision. But it should be embedded in an Navision form. Look at the link. It should look like that: http://www16.brinkster.com/moonlightkr/picture.htm

Great idea! Use Navision as shell and put other programms into a box [8D]. IMHO unfortunately impossible[:(] but I wish this would be possible. Only a picture of the IE should work. bye André

Maybe you can code web browser in C/AL on your own ? That would be great idea. Also I don’t think Microsoft will like that IE isn’t used [:p]

No graphical OCX can be used on navision… only nongraphical ones, sorry. Regards,

Thank you all for your comments. But the solution Im searching for is possible. The attached link is no fake. Its an old sample program. If you like I could add the Setup for download as proof. Karsten

Karten… it was probably using a different way for having the webpage on the screen, as navision gives you an error if trying to use a graphical ocx on it all straight… if you want to add the setup could be nice having a look at it :slight_smile: Regards,

Hi There is one round about way of doing this. Not exactly on a Navision form but on a visual basic form. What can be done is write a ocx and an exe both in vb. The work of the ocx will be to read values from the navision form and pass them onto the vb exe and also to pass any values back from the vb exe to the navision form. The exe will have maybe one or more forms depending on the particular requirement. It will read the values and do the required work for u. The exe should be made application wide modal so that till the exe is being processed the navision form as well as the navision application will not get focus. I hope this is what u were looking for. If u require any further clarification do feel free to ask. Regards Akshay

As promised the sample for download. http://www16.brinkster.com/moonlightkr/Download.htm Just register the dll files for your OS (Win9x or WinNt_2000), import the fob and run the form. When you edit the form you will be suprised. :wink:

Hi Akshay, hmmm. I understand your solution, but its not the way Id like to do it. If you take a look at the example you will see why I want to embed an object directly into a navision form. But for your solution I have a question:

quote:


Originally posted by akshay99
What can be done is write a ocx and an exe both in vb. The work of the ocx will be to read values from the navision form and pass them onto the vb exe and also to pass any values back from the vb exe to the navision form.


Why should I write an ocx for a communication between the vb.exe and navision ? Its easier to create an ActiveX Exe as automation server and do a direct communication between Navision and VB Exe. The ocx is not necessary. Karsten

Karsten, Thanks for the download - it looks very interesting! Sorry I can’t shed any light on the subject. [V] Keeps us informed if you work it out. [:)]

Ya that is also possible. The thing is this will be more modular and easy to maintain. Akshay

This example looks great ! I have been looking for a solution like the example that Karsten has sent. I want to display a large memo field as a subform on a Navision form. But how do these ActiveX components work? Well it seems that they request a handle to the Navision form by sending its capture. Then they use this handle to draw an object on the form. Some properties like x,y,height,width are also passed to the dll so you can also kind of simulate the navision glue properties. How this is coded I don’t know. You’ll probably need Visual C++ or maybe Deplhi. I don’t think Visual Basic can do these kind of things. But I have no clue on how the implementation is done. Very tricky I think. If someone find’s out, pleas post! btw the sample crashes Attain 3.60 but in financials 2.60 it runs great!

quote:


Originally posted by janpieter
This example looks great ! … btw the sample crashes Attain 3.60 but in financials 2.60 it runs great!


I’ve tried running it in Attain 3.60 no problems.

Maybe the combination Attain 3.60 and WinXP… I hope i’ll get some time this week to study embedded controls. Would be great if this worked.

quote:


Originally posted by janpieter
Maybe the combination Attain 3.60 and WinXP… I hope i’ll get some time this week to study embedded controls. Would be great if this worked.


Oops. I am on WinXP too. hehe Still no problems.

quote:


Originally posted by janpieter
Maybe the combination Attain 3.60 and WinXP… I hope i’ll get some time this week to study embedded controls. Would be great if this worked.


Probably… it crashed also on my XP home edition with a 3.60… Regards,

hehe, i’m using XP pro SP1. But i don’t care if it works in 3.60 as it is a demo and technical not useful except for the idea to embed controls on Attain forms.

I have found a way to embed controls in Navision! though it is quite hard… You will need to create an ATL extension in Visual C++. Don’t know if version 6.0 can do this, i created something in .NET. With ATL you can put every control you like (or develop yourself) on a Navision form! What i did so far is placing the MS Calendar control on an Atain 3.60 form. The control sticks to the size of the form. Then I could use this control as a subform in another form. Looks really cool. Though I cant get the deconstructor to work properly so i cant’t start the control twice. For experienced C++ programmers some hints: (if you’re not a c++ programmer this will be very hard) - start ATL project - get handle to window by calling GetFocus() (don’t execute this while debugging) - Look for examples in MSDN for AtlAxCreateControlEx - Dont’t bother creating control containers, use Navision form directly. - Create an event sink (also documentated in MSDN) If someone can get the deconstructor right i would be very interested…