Library exposed to COM in X#

This forum is meant for examples of X# code.

Post Reply
gjbiagiotti
Posts: 33
Joined: Thu Aug 15, 2019 10:16 pm

Library exposed to COM in X#

Post by gjbiagiotti »

Hello.
I need to create in X# a library exposed to COM, is there a writing that explains how to do it?

Thank you. Gerardo.
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Library exposed to COM in X#

Post by wriedmann »

Hi Gerardo,
works well, I have a lot of them, and created the last one last week.
Please see:
https://docs.xsharp.it/doku.php?id=com_module_sample
https://docs.xsharp.it/doku.php?id=com_module_sample_vs
https://www.riedmann.it/download/SendMailCOM.zip
https://www.riedmann.it/download/PostgreSQLReader.zip

The first two are documentations, the other two samples and working DLLs (both of them created by myself and used by several people).

If you have questions, please let me know.

Wolfgang

P.S. the main specialist for such libraries is Meinhard Schnoor, and he held a session about this last year in Memmingen. I do not know if you have access to this session material:
https://www.xsharp.eu/itm-downloads/dow ... chnoor.zip
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
gjbiagiotti
Posts: 33
Joined: Thu Aug 15, 2019 10:16 pm

Library exposed to COM in X#

Post by gjbiagiotti »

Thanks Wolfgang
gjbiagiotti
Posts: 33
Joined: Thu Aug 15, 2019 10:16 pm

Library exposed to COM in X#

Post by gjbiagiotti »

Hello Wolfgang.

Is it possible to create a dll from X# using VO's SQLClasses and DBServer?
And then generate the DLL and the TPL file to import it from VO?

Thank you.
Gerardo
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Library exposed to COM in X#

Post by wriedmann »

Hi Gerardo,
unfortunately it is not possibile to create an X# DLL using VO libraries.
But you can create an X# library using the X# versions of VO libraries, and build a COM library.
But the COM interface does not knows anything about the special VO and X# datatypes, so you have to build your own interface class and definition to access properties and methods of your COM library.
Therefore the interface can never be compatible to what a VO SQL Editor or a VO DBServer Editor would expect.

But the question I have is: what do you plan to do with such a construct?

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply