PlanetSquires Forums

Support Forums => General Board => Topic started by: Marc Pons on October 11, 2016, 07:50:43 AM

Title: Create your own ActiveX ocx for visual control with Freebasic , prototype
Post by: Marc Pons on October 11, 2016, 07:50:43 AM
As a vb6 guy, I was always using the activeX controls,
that why i was interested by the huge work done by Jose on COM.

I'm not the inventor of the following , it comes originally from Alober
I've just worked on it to understand more on COM,  so i've adapted it to be easy to understand at least for me.

Thanks to Jose, Alober and also Loe from the freebasic Forum , following/using/adapting their codes
i was able to understand better, even its not finished...

but i think, it is possible to share here, a sample of visual activeX component
totally done with Freebasic (except the .tlb wich is produced by midl.exe / part of visual c++ )

and an exe test to play with.

Its not complete because i'm still not understanding how to play with some interfaces,
but functionnal as activeX definition with 1 class and 1 event class

The test shows how to use 2 controls on the same application and detect the events from each of them

sorry: the attachment was not the right one , updated now :-\
Title: Re: Create your own ActiveX ocx for visual control with Freebasic , prototype
Post by: aloberr on October 12, 2016, 11:19:58 AM
I appreciate your efforts, I 'am going to glance your post
Title: Re: Create your own ActiveX ocx for visual control with Freebasic , prototype
Post by: Marc Pons on October 15, 2016, 03:12:27 PM
New evolution,

this time, with embeeded manifest file on the exe test  (no more need to have it on the same folder as the exe )

more important modification, the server (ocx) use the implemented   IoleWindow : getWindow method
to "attach" the component to a "pseudo-container" provided by the client (exe)

it is closer to the normal Atl container way than, the previous work-arround, searching a specific window as parent...

But still not implementing full container, not needed for simple visual component like that:
2 OleAutomation interfaces inheriting fom IUnknown, (not IDispatch)

remember, it is just a proof of concept to create Visual ActiveX Component with FreeBasic, but works.

Title: Re: Create your own ActiveX ocx for visual control with Freebasic , prototype
Post by: ganlinlao on October 16, 2016, 02:28:45 AM
Very good, thank you, I can learn how to use Freebasic to write activeX, COM technology is still very important, especially the use of existing Report and chart components.