Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » how to embed a D/COM control in my U++ GUI ?
how to embed a D/COM control in my U++ GUI ? [message #616] Fri, 20 January 2006 20:07 Go to next message
razvan is currently offline  razvan
Messages: 2
Registered: January 2006
Junior Member
Hi,

I'm trying to embed a COM control, (in my case the WebBrowser) in an application.
I saw the OLE/CTRL classes, but I can't figure out how to use them.
If you can give me a short example or some tips, it will be very helpful.

Thank you,
Razvan
Re: how to embed a D/COM control in my U++ GUI ? [message #636 is a reply to message #616] Mon, 23 January 2006 10:25 Go to previous messageGo to next message
rylek is currently offline  rylek
Messages: 79
Registered: November 2005
Member
Hello!

Unfortunately, this is not very simple. To be honest, the lack of an OLE container object is one of the big omissions in the current version of U++. Of course we would love to have one but, as we have always financed U++ development by our commercial projects, we haven't met the demand for it yet (on the other hand, it is already possible to develop ActiveX controls as such using the U++ library). As usual, all volunteers are welcome to help us on this, however I'm afraid that at least some cooperation from me or Mirek will be needed in any case as it is quite likely to have some fallout on the control core module and the window management system.

Regards

Tomas
Re: how to embed a D/COM control in my U++ GUI ? [message #644 is a reply to message #636] Mon, 23 January 2006 15:08 Go to previous messageGo to next message
ucanca is currently offline  ucanca
Messages: 9
Registered: January 2006
Location: London, UK
Promising Member
Hi - I'm in the same situation as Razvan.

Specifically, regarding a webbrowser, how easy would it be to use HTMLayout (http://www.terrainformatica.com/htmlayout/)?

Apparently, it also can be used through the good ol' Win32 API but this means handling the Win32 messages and I don't know how to this either... Could someone provide me with some pointers, please?

Thanks!
Re: how to embed a D/COM control in my U++ GUI ? [message #653 is a reply to message #644] Mon, 23 January 2006 22:04 Go to previous messageGo to next message
ucanca is currently offline  ucanca
Messages: 9
Registered: January 2006
Location: London, UK
Promising Member
Hi - again.
Back from work and I had a look at U++'s internals.

Am I right in saying that to answer my own question above (how to handle Win32 messages), I need to:

1. Derive MyControl from Ctrl

2. Add the following code to MyControl.ccp
LRESULT MyControl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hWnd = GetHWND();
switch(message) {
case WM_MessageIWantToHandle:
MyHandler(hWnd);
return 0;
}

return Ctrl::WindowProc(message, wParam, lParam);
}

void MyControl::MyHandler(HWND hWnd) { ... }

Is that all it takes or have I missed some key step?

Thanks!


[Updated on: Mon, 23 January 2006 22:12]

Report message to a moderator

Re: how to embed a D/COM control in my U++ GUI ? [message #657 is a reply to message #653] Mon, 23 January 2006 23:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Correct.

There is however one thing you should know: Normal "child" Ctrls do not have associated HWND (just top-level Ctrls have one).

However, there is special Ctrl derived "DHCtrl" class that is basicaly child Ctrl with HWND.

Mirek
Re: how to embed a D/COM control in my U++ GUI ? [message #659 is a reply to message #657] Tue, 24 January 2006 00:34 Go to previous messageGo to next message
ucanca is currently offline  ucanca
Messages: 9
Registered: January 2006
Location: London, UK
Promising Member
That's the bit I couldn't work out! Many thanks, luzr.

I'm still pretty new to U++ but I'm absolutely amazed by what you guys have achieved - this framework deserves to be far more widely known!!
Re: how to embed a D/COM control in my U++ GUI ? [message #904 is a reply to message #644] Tue, 07 February 2006 17:15 Go to previous messageGo to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
ucanca wrote on Mon, 23 January 2006 09:08

Specifically, regarding a webbrowser, how easy would it be to use HTMLayout (http://www.terrainformatica.com/htmlayout/)?

Apparently, it also can be used through the good ol' Win32 API but this means handling the Win32 messages and I don't know how to this either... Could someone provide me with some pointers, please?

The license of HTMLayout is more restrictive than of U++. If you release non-free apps with HTMLayout, you have to pay $350. Seems like a big obstacle for me...
Re: how to embed a D/COM control in my U++ GUI ? [message #905 is a reply to message #904] Tue, 07 February 2006 20:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
BTW, depends what you consider "HTML viewer". "Basic" HTML, without JavaScript, DHTML etc.. should not be that hard to implement - most likely as HTML -> RichText convertor.

Mirek
Re: how to embed a D/COM control in my U++ GUI ? [message #925 is a reply to message #905] Thu, 09 February 2006 12:31 Go to previous messageGo to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
As an exercise I created the most simple HTML->Qtf converter. Currently it can only handle <b><i><u><s> and <br>. Feel free to improve and extend.
You can also use the example app to experience with the Qtf format in real-time.
  • Attachment: HtmlDemo.zip
    (Size: 1.75KB, Downloaded 1642 times)
Re: how to embed a D/COM control in my U++ GUI ? [message #958 is a reply to message #925] Fri, 10 February 2006 01:27 Go to previous messageGo to next message
ucanca is currently offline  ucanca
Messages: 9
Registered: January 2006
Location: London, UK
Promising Member
Thanks, hojtsy - I'll have a go this weekend!

Re: Htmlayout's license, you're right, it is not really an option for a commercial application. FYI and for rendering only, QHTM (http://www.gipsysoft.com/qhtm/) looks like a much cheaper alternative. (it is actually the solution I had gone for...)

Ideally, embedding IE or the ActiveX version of the Mozilla browser would be a far better solution (apologies to the non-Windows developers Wink) but this would require U++ to support COM/ActiveX objects... (definitely above my current U++ skills for the time being Sad)
Re: how to embed a D/COM control in my U++ GUI ? [message #1585 is a reply to message #905] Thu, 09 March 2006 07:17 Go to previous message
c-smile is currently offline  c-smile
Messages: 1
Registered: March 2006
Location: Canada
Junior Member
luzr wrote on Tue, 07 February 2006 11:13

BTW, depends what you consider "HTML viewer". "Basic" HTML, without JavaScript, DHTML etc.. should not be that hard to implement - most likely as HTML -> RichText convertor.
Mirek


Propbably this would be interesting somehow:

http://www.terrainformatica.com/wiki/pmwiki.php/Harmonia
It is a GUI library for D programming language / digitalmars.com. It is functional analog of U++ as far as I can see, but in D.

Harmonia has simple HTML alike engine used for Declarative UI purposes - layout of dialogs, forms, help, etc.

So probably it makes sense to port it in U++.

And regarding HTMLayout and for information: I also have windowless version which can be integrated better in U++.

Andrew.
Previous Topic: Puzzle example issue
Next Topic: ExpressPane
Goto Forum:
  


Current Time: Thu Mar 28 18:28:01 CET 2024

Total time taken to generate the page: 0.00958 seconds