View Full Version : New to COM / thinbasic
Kirk Friend
02-10-2018, 13:57
Hello,
As this is my first post let me introduce myself, I am Kirk a 28 year old software engineer from the UK. I have a degree in computer science and mathematics and have a passion for computer graphics. I currently work at a big firm which creates software to support the development and data capture of clinical trials around the world. I enjoy messing around with different dialects of BASIC and tried thinbasic many years ago, so I am glad to see development has continued. I am also part of the Facebook group so you may have seen my name knocking around.
I have no experience with COM, unfortunately my knowledge is as in-depth as the short msdn article I found. While the examples made it clear you need to setup a reference to a interface, it left me wondering what the ServerName parameter of COM_CREATEOBJECT() actually is. As I understand COM interface can be a DLL but where does this function try locate the interface?
Apologies in advance if I have got this function misunderstood, but the docs are very sparse here.
Kirk
ErosOlmi
02-10-2018, 15:37
Ciao Kirk,
and welcome to community forum.
Yes thinBasic is still maintained, there is a little gab in releasing new versions because I'm finishing a big new release full of new functionalities.
I added too much new options and I went long in releasing them all. I will never do such big changes all together, too complex.
I'm sorry but COM module has been actually deprecated even if still distributed: https://www.thinbasic.com/public/products/thinBasic/help/html/index.html?com.htm
In future thinBasic versions iDispatch functionality will substitute it.
In any case "ServerName" or "ClassName" or "progId" is the string that identify an automation object present in your computer.
Giving that ProgramId (Program Identifier) to COM_CreateObject should be able to create an instance of that object and work with it,
There are some applications around you can use to see what automation objects are present in your computer, attached the one I use created by José Rocha: https://forum.powerbasic.com/forum/jose-s-corner/source-code-ab/53176-the-making-of-a-typelib-browser
I found some reference quite useful:
http://resources.esri.com/help/9.3/arcgisdesktop/com/COM/IntroToCOM.htm#AUTOMATION
https://www.codeproject.com/Articles/13601/COM-in-plain-C
http://pubs.opengroup.org/onlinepubs/009899899/
Let me know.
Ciao
Eros
Kirk Friend
02-10-2018, 19:57
Hello Eros,
Thanks for the warm welcome.
Sounds good, I am looking forward to see what new features the next update brings! I have just looked up iDispatch and it looks interesting, is this something coming in the next update or is it something in the Beta version? I only have the current stable release.
Although I haven't managed to read through the entire content of the links provided, they seem extremely well detailed and good resources to have, I will continue to read through the first introduction to broaden my understanding. Also the link to the PB application is very useful as it's a nightmare to locate this information in regedit.
Thanks
Kirk
ErosOlmi
02-10-2018, 20:10
Sounds good, I am looking forward to see what new features the next update brings! I have just looked up iDispatch and it looks interesting, is this something coming in the next update or is it something in the Beta version? I only have the current stable release.
Better to get version 1.10.4 update a while ago but started to introduced many new aspect including iDispatch or 1.10.5 that I update every week or so but it can contains some important bug or debug messages.
For iDispatch after installation check under \thinBasic\SampleScripts\iDispatch\ directory for some ongoing examples
Here link to the post I use to update forum: https://www.thinbasic.com/community/showthread.php?12778-thinBasic-1-10-x
Here direct download links:
https://www.thinbasic.biz/projects/thinbasic/thinBasic_1.10.4.0.zip
https://www.thinbasic.biz/projects/thinbasic/thinBasic_1.10.5.0.zip
Although I haven't managed to read through the entire content of the links provided, they seem extremely well detailed and good resources to have, I will continue to read through the first introduction to broaden my understanding. Also the link to the PB application is very useful as it's a nightmare to locate this information in regedit.
Yes, COM is quite vast and complex at first but if you start getting it ... it will open a great new world. It takes some time.
With iDispatch variables I will try to make COM Automation as easy as I can.
ErosOlmi
02-10-2018, 20:28
I currently work at a big firm which creates software to support the development and data capture of clinical trials around the world.
I too worked many years ago in a similar company, not big, only 40 people. It was my first job.
We organized clinical trials for pharmaceutical industry (mainly for companies from Switzerland ;) ), creating paper and software for data collection, made stats.
:)
Kirk Friend
03-10-2018, 09:46
Ciao Kirk,
I found some reference quite useful:
http://resources.esri.com/help/9.3/arcgisdesktop/com/COM/IntroToCOM.htm#AUTOMATION
https://www.codeproject.com/Articles/13601/COM-in-plain-C
http://pubs.opengroup.org/onlinepubs/009899899/
Eros
The first resource is an excellent resource and was extremely helpful.
I too worked many years ago in a similar company, not big, only 40 people. It was my first job.
We organized clinical trials for pharmaceutical industry (mainly for companies from Switzerland ;) ), creating paper and software for data collection, made stats.
:)
Sounds very similar to what we are doing, although my company has branched out to various phases of clinical trials we do EDC, ePRO and medical imaging. However, our main line of business is ePRO, we develop Android and iOS applications to assist subjects in completing these diaries and provide reporting services to our clients such as those Swiss powerhouses, Novartis, Roche, Merck and GSK.
Thanks
Kirk
John Spikowski
03-10-2018, 14:16
Eros,
That is outstanding news!
And I thought you just ignored my VB6 OCX DLL Forms project I have going on at AllBASIC.info.
ErosOlmi
03-10-2018, 15:53
That is outstanding news!
Which one?
:D
John Spikowski
03-10-2018, 16:31
thinBasic COM/OLE automation support.
See the comment to Rene in the HTTPS thread.
Here is the All BASIC link again.
VB6 OCX Forms (https://www.allbasic.info/forum/index.php?topic=493.0)
John Spikowski
05-10-2018, 19:13
Eros,
I understand you're busy with UDT stuff but what I'm proposing using VB6 OCXs as intelligent form objects of any interest to you?
ErosOlmi
05-10-2018, 19:53
John sorry and please forgive me but I have little time and I do not follow other's projects.
I have so many ideas in my mind about thinBasic and so little time to dedicate to it so I cannot waste it.
I usually develop what people ask here in forum or what I need in using thinBasic every time at work.
At work I'm having so many satisfactions in developing in few hours, sometimes minutes, what to others take days.
And I'm not a programmer at work but "just" an IT manager :)
So I will continue on this path.
Regarding COM I'm more interested in automation other than ActiveX graphic components.
With iDispatch variable recently added to thinBasic, I think COM automation in thinBasic starts to have a clear and easy dotted notation syntax
What I'm working on is handling events from instantiated COM objects.
Then I will try to be able to interact with the .Net galaxy.
Ciao
Eros
John Spikowski
06-10-2018, 00:02
That's a shame. The VB6 OCX DLL Forms controlled by automation is a no brainier and a great way to get a professional looking UI going in a hurry.
You may want to take a second look when you get more time.