First COM attempt: IFileOpenDialog

Started by José Roca, April 06, 2016, 02:13:57 PM

Previous topic - Next topic

José Roca

Doing calls directly to the vtable instead of calling invoke.

José Roca

In VB6, forms are instances of an OLE container. Therefore, they are perfectly suited to host ActiveX controls.

In SDK programming, they are windows, and you need to add an OLE container that will host the ActiveX.

If you are going to develop a control to be used with a SDK window, there is absolutely no need to do it as an ActiveX. It will integrate and work much better if it follows the rules of standard Windows controls. How you write it is up to you, as long as it works as a child of the parent window, not like ActiveX that need a middleman. If you prefer to send events instead of notification messages, it is your business.

Paul Squires

Yeah, ActiveX is dead and a waste of time at this point. It is easy to write custom controls using standard window classes. Sure only today I was looking for a way to better skin the Scintilla scrollbars and then I said, screw it, I'll just write my own. I used a CWindow and treated it like a control. I just counted it and it took less than 100 lines of code. It is super small and super fast. Very little overhead.
Paul Squires
PlanetSquires Software

Paul Squires

One of the serious downfalls of languages is the lack of ready to use GUI components. That's why Visual Basic was so successful. It was incredibly easy to just plug in a pre-built GUI gadget. There was a huge market for it. PowerBasic struggled because very few people wrote visually appealing GUI gadgets. A few grid controls and a few fancy looking buttons, etc. Other than Patrice's WinLift, I can't think of any other controls that rivaled VB's, or Visual C++'s.
I would love nothing more than to be able to take a few months and just code a whole collection of GUI gadgets. It would make programming everyday applications so much easier.
Paul Squires
PlanetSquires Software

aloberr

you does not seem clear on this blow Jose .  Because what you indicates by low level COM is as well COM
In more the Invoke method does not relate to only controls activeX, but also the interfaces which inherit IDISPATCH. 
Did you already consult my CE control on the Freebasic forum  ?  it is used as a simple Windows control but it is always necessary to implements at least IUNKNOWN interface IUNKNOWN and for me  with the  use of IDISPATCH , the Invoke method is more flexible and makes it possible to use only the code which one needs. 
COM Technology  with my direction is challenged by .net technology, but it will be able to always exist at least as long as microsoft will distribute stdole2.tlb and as long as the headers of microsoft will not be re-examined.  COM remains for me the fastest technique. and the natural one by using classes.

José Roca

> In more the Invoke method does not relate to only controls activeX, but also the interfaces which inherit IDISPATCH.

Microsoft writes all its COM servers using low-level COM (inheriting directly from IUnknown, not IDispatch). In the times of VB6, that could not use these low-level interfaces, they usually added an IDispatch wrapper on top of the low-level interfaces. Now that VB6 is dead an buried, they no longer do this unless they want to make it available to scripting languages.

I learned COM programming to be able to use the COM servers of my interest, but I'm not interested at all in writing ActiveX controls. I prefer to write them using the API way.