mibuso.com

Microsoft Business Solutions online community
It is currently Fri May 24, 2013 11:19 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Draw External Control
PostPosted: Tue Jan 03, 2006 1:26 pm 
Offline
Site Admin

Joined: Sun Nov 07, 1999 8:01 am
Posts: 1901
Location: Wilrijk, Belgium
Country: Belgium (be)
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.


Top
 Profile  
 
 Post subject: Hmm..... it cannot compile (?)
PostPosted: Wed Jan 04, 2006 2:03 pm 
Offline

Joined: Mon Feb 14, 2005 12:58 pm
Posts: 26
Location: Copenhagen
Country: Denmark (dk)
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 Ohm


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 2:23 pm 
Offline

Joined: Fri Jul 16, 2004 2:55 pm
Posts: 126
Location: London
Country: Portugal (pt)
That error, and a lot more :wink: , 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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 09, 2006 11:14 am 
Offline

Joined: Wed Jul 07, 2004 10:20 am
Posts: 80
Location: Work
Country: Netherlands (nl)
Haven't tried it yet, but cool that you post the code on the internet.

Guido


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 11:46 am 
Offline

Joined: Tue Feb 22, 2000 8:01 am
Posts: 911
Location: Glasgow
Country: United Kingdom (uk)
Draw External VISUAL(!) control?

Does it works in Navision <= 3.70.B.

Regards

_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein

“A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.”
― Douglas Adams, Mostly Harmless


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 1:35 pm 
Offline

Joined: Fri Jul 16, 2004 2:55 pm
Posts: 126
Location: London
Country: Portugal (pt)
it should work with all versions


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 1:39 pm 
Offline

Joined: Tue Feb 22, 2000 8:01 am
Posts: 911
Location: Glasgow
Country: United Kingdom (uk)
Quote:
it should work with all versions


I should work or it working?

_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein

“A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.”
― Douglas Adams, Mostly Harmless


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 4:41 pm 
Offline

Joined: Fri Jul 16, 2004 2:55 pm
Posts: 126
Location: London
Country: Portugal (pt)
Have not tryed it yet so i dont know


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 12:20 pm 
Offline

Joined: Fri Mar 28, 2003 11:31 am
Posts: 33
Location: Slovenia
Country: Slovenia (si)
Bump.

So, anyone got this built? Anyone knows what exactly is happening in the code, could it be done in other than .net?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 12:30 pm 
Offline

Joined: Fri Jul 16, 2004 2:55 pm
Posts: 126
Location: London
Country: Portugal (pt)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 6:23 pm 
Offline

Joined: Tue Feb 22, 2000 8:01 am
Posts: 911
Location: Glasgow
Country: United Kingdom (uk)
zehnan wrote:
Bump.

So, anyone got this built? Anyone knows what exactly is happening in the code, could it be done in other than .net?


Yes, possible. In VB6.

_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein

“A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.”
― Douglas Adams, Mostly Harmless


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 10:11 am 
Offline

Joined: Fri Mar 28, 2003 11:31 am
Posts: 33
Location: Slovenia
Country: Slovenia (si)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 11:36 am 
Offline

Joined: Tue Feb 22, 2000 8:01 am
Posts: 911
Location: Glasgow
Country: United Kingdom (uk)
To allow resizing you have to override default control's 'WndProc' (subclassing).

_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein

“A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.”
― Douglas Adams, Mostly Harmless


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 12:29 pm 
Offline

Joined: Fri Mar 28, 2003 11:31 am
Posts: 33
Location: Slovenia
Country: Slovenia (si)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 12:38 pm 
Offline

Joined: Tue Feb 22, 2000 8:01 am
Posts: 911
Location: Glasgow
Country: United Kingdom (uk)
Each normal(!) visual control in Windows has own "window procedure" to receive different kind of messages from OS. You have to receive this messages (WM_SIZE at least) and resize your control to fit available "client bounds".

I'm not a C programmer. In VB6/VB.NET/C# it's pretty easy.

_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein

“A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.”
― Douglas Adams, Mostly Harmless


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: