Draw External Control

Administrator
Member, Moderator, Administrator Posts: 2,506
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.
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.
0
Comments
-
e:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxv_w32.h(18): fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
What is the problem?Best regards
Henrik Ohm0 -
That error, and a lot more
, apeared to me also and i had to deal with them. I dont have the answer right away, but when i have some time, maybe in the weekend, i will try to create a project from scratch and document all my steps and all error solutions. It was a hard fight for me the first time i did it.
Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
Haven't tried it yet, but cool that you post the code on the internet.
Guido0 -
it should work with all versionsAndre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
Have not tryed it yet so i dont knowAndre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
Bump.
So, anyone got this built? Anyone knows what exactly is happening in the code, could it be done in other than .net?0 -
I've tried in other languages but got no results.
You have to understand and know c++ to compile or change this project, there are no miracles.Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
I couldn't build the above example, but I managed to make it from scratch (with lots of googling and learning a bit C++
. I started a new atl project (vs2005), added a simple object class and implemented a slightly modified version of your your code. It works quite nice and it can host all sorts of controls (even browser).
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.0 -
Care to explain that a bit more? By default control you mean my atl object or the hosted control? I can't find any WndProc methods in those. Then again, this is my first time c experience, so I apologize if i ask stupid questions.0
-
I added an event to WM_SIZE. However, it doesn't seem to respond to resizing, so nothing really happens. Anyway, it's enough for today. Have a nice weekend.0
-
Very cool =D> , really appreciate you posting the source code for this!
This solved my compile error btw.
http://forums.microsoft.com/MSDN/ShowPo ... 1&SiteID=1
Thanks a lot for sharing0 -
nono dont try catch resize events.
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.In a world without Borders or Fences, who needs Windows and Gates?0 -
Hmm if you dont believe me ... =;
I never had to do that though i created this product :
http://www.mibuso.com/dlinfo.asp?FileID=333In a world without Borders or Fences, who needs Windows and Gates?0 -
Anybody got a working sample in c#?
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 ](*,)0 -
This topic is not about MDI forms but about OCX controls.In a world without Borders or Fences, who needs Windows and Gates?0
-
I have a visual external control in c#.
All I want is to embedd it in a subform of Navision.0 -
wakestar wrote:I have a visual external control in c#.
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.In a world without Borders or Fences, who needs Windows and Gates?0 -
ok, thanks janpieter
at the end I don't care about the way it is solved. When it works I'm happy0 -
there is one problem though, if i draw an editable ocx using this dll, it's not letting me input text or change any other value on the ocx, it displays it correctly though, anyone can help me on that?Saro0
-
Saro wrote:there is one problem though, if i draw an editable ocx using this dll, it's not letting me input text or change any other value on the ocx, it displays it correctly though, anyone can help me on that?
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.In a world without Borders or Fences, who needs Windows and Gates?0 -
janpieter
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 internallySaro0 -
Saro wrote:janpieter
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 ...In a world without Borders or Fences, who needs Windows and Gates?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions