Draw External Control
This download shows how you can draw an external control directly in a Navision form.
Don't forget to compile the project first to create and register the DLL. Then use the form 88000 to see the result. This is a raw and simple project. There's a lot of improvement a skilled c++ developer can accomplish.
Contains:
1- Project .Net C++ (open the project and compile to create and register the dll!!!)
2- Navision form with a reference to the dll
Sorry for the lack of documentation but didn't had the time to do it.
Hope someone can create some nice things and share with the mibuso community.
A great year to everyone.
http://www.mibuso.com/dlinfo.asp?FileID=548
Discuss this download here.
Comments
What is the problem?
Henrik Ohm
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
Guido
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
So, anyone got this built? Anyone knows what exactly is happening in the code, could it be done in other than .net?
You have to understand and know c++ to compile or change this project, there are no miracles.
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
Now, I would like to implement the code to respond to resize events. Normaly the external control wouldn't resize. I can call the function to update the window size from Navi, but that's not really it. Any ideas or suggestions in which direction to look?
Thanks.
This solved my compile error btw.
http://forums.microsoft.com/MSDN/ShowPo ... 1&SiteID=1
Thanks a lot for sharing
Bruno
http://blogs.ittoolbox.com/erp/smb
You have to use the handle of the navision (sub)form to act as a container. The MSDN examples i remember creates its own window as a container. This is not necesary just use the hwnd or cwnd of the (sub)form.
When the container is right, then it will size automatically according to the container.
I never had to do that though i created this product :
http://www.mibuso.com/dlinfo.asp?FileID=333
I'm going nuts with this! I'm able to find out the handle of the navision form / subform.. but I cannot set the MdiParent property of my custom form in VS 2005 ](*,)
All I want is to embedd it in a subform of Navision.
MDI properties are not available for OCX controls as you are not working on Multiple Document Interface there.
Listen, the thing we are doing here isn't something you can do with properties. It is verry unusual to host OCX controls in applications that you did not design (like Navision).
I don't really think C# is cappable of doing the hosting bit. You will have to reside to some C++ magic with its ATL libraries. See the posted example.
I'm not really into embedding C# controls, you might have to compile the OCX in a way that it supports COM. But i'm not sure about that.
at the end I don't care about the way it is solved. When it works I'm happy
This also is my biggest problem. Navision is always taking back the focus. Somehow this is done with postmessage API calls i think. If you can catch those events then you can probably prevent these messages from getting back to standard navision fields.
Though it is a bit dangerous to make these kind of changes to navision behavoir. You would not want to prevent those messages from being send when you click on a navision field otherwise Navision will never receive the focus again! And i think you will encounter many more other problems. That's why I stopped trying to deal with it quite soon.
If you manage to implement this it would be a great achievement.
(oh probably text input is possible if you don't use text fields on the form the control is drawn on).
So far i only managed to have controls drawn that only supports visual and mouse user interaction. No keyboard. But even this has a lot of cool possibilities.
thank you for the response that was very helpful, i suppose we can wait till 5.0 is out, maybe with the .net backend we will be able to use such things, probably even internally
glad to help.
umg sure hope so but i have doubts ...