Alaska Software Inc. - Re: Xbase++ / Python interface
Username: Password:
AuthorTopic: Re: Xbase++ / Python interface
Claudio Driussi Re: Xbase++ / Python interface
on Sun, 08 Apr 2018 17:23:40 +0200
Hi everybody,

A lot of time ago

Il 04/03/2014 13:11, Lorenzo Succi wrote:
> Hi, Xbase users.
> I'm experimenting to interface Python with Xbase++.
> You can download a zip with some functions working in this site:
> http://www.lsuccicinfo.it
> section: download
> Comment or problem report is liked.
> Bye.
> Lorenzo Succi

I tried to compile with Visual Studio 2017 Community,
but I got many errors.

Some one has tried it?

And in general there is a way to write a very simple
dll in C which access to xpp variables system with VS2017?

Or even build a C obj file linkable in xpp projects?

P.S. I'm using xpp 1.90.355

Many thanks.
Claudio Driussi
Jim LeeRe: Xbase++ / Python interface
on Sun, 08 Apr 2018 21:41:10 +0200
>And in general there is a way to write a very simple
>dll in C which access to xpp variables system with VS2017?

i build a COM DLL with VS2015

>Or even build a C obj file linkable in xpp projects?

you have \SOURCE\samples\basics\CAPI\ so it is possible

>P.S. I'm using xpp 1.90.355

since v1,9x you have ActiveX to use COM
Claudio Driussi Re: Xbase++ / Python interface
on Mon, 09 Apr 2018 08:21:29 +0200
Il 08/04/2018 21:41, Jim Lee ha scritto:
>> And in general there is a way to write a very simple
>> dll in C which access to xpp variables system with VS2017?
> 
> i build a COM DLL with VS2015

Fine, but COM mean that is independent from Xbase++ and
linked only at runtime.

>> Or even build a C obj file linkable in xpp projects?
> 
> you have \SOURCE\samples\basics\CAPI\ so it is possible

Yes! I didn't remember this.

But what compile I can use? I'm not sure I can compile it
with VS2017 I will try.

>> P.S. I'm using xpp 1.90.355
> 
> since v1,9x you have ActiveX to use COM

Can be a way. I need to communicate with Python because
it has a huge library for internet and many protocols,
and the scripts can be modified without recompile
the whole xpp project but I need to interact at runtime.
Now from xpp I write intermediate files and then I run
the scripts but with interaction I can do better things.

Thanks
Jim LeeRe: Xbase++ / Python interface
on Thu, 12 Apr 2018 02:45:21 +0200
hi,

i do not speak Python so i do not know if COM is a Option.

Xbase++ activeX is limited to IDispatch Interface.
you can access IUnknown Interface like ITaskbarList when build your own 
Xbase++ Wrapper with ot4xb.

* ----- shlobj.h ----- *
#define INTERFACE ITaskbarList

DECLARE_INTERFACE_(ITaskbarList, IUnknown)
{
     *** IUnknown methods ***
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
    STDMETHOD_(ULONG, AddRef) (THIS) PURE;
    STDMETHOD_(ULONG, Release) (THIS) PURE;

* ----- Xbase++ ----- *
#xtranslate ITaskbarList_uuidof()                                => 
UuidFromString("56FDF342-FD6D-11d0-958A-006097C9A090")

#xtranslate ITaskbarList_QueryInterface( <pi>, [<params,...>])   => 
IFpQCall( 0,"__sl__sl__pt_@sl",<pi> [,<params>] )
#xtranslate ITaskbarList_AddRef( <pi>)                           => 
IFpQCall( 1,"__sl__sl",<pi>)
#xtranslate ITaskbarList_Release(<pi>)                           => 
IFpQCall( 2,"__sl__sl",<pi>)

all COM have these 3 Methode so your own Methode start with Number 3 
(Zero-based)
if your have a *.h than Number must have same Order in your #xtranslate line


i try to to read
Kraig Brockschmidt - Inside Ole, Second Edition
... it is hard Stuff (1194 pages)
Claudio Driussi Re: Xbase++ / Python interface
on Thu, 12 Apr 2018 18:56:56 +0200
Il 12/04/2018 02:45, Jim Lee wrote:
> hi,
> 
> i do not speak Python so i do not know if COM is a Option.
> 
> Xbase++ activeX is limited to IDispatch Interface.
> you can access IUnknown Interface like ITaskbarList when build your own
> Xbase++ Wrapper with ot4xb.

ot4xb is a great library! I use it.

BTW I don't need Xbase++ to be a COM server, but I need an
interactive communication between Python and xpp.

Python allow to be embedded into applications with a C
interface, so i need to compile to compile a C module
into XPP project, and I'm in little trouble because
I cant find the right compiler and I'm not skilled in
C compiling.

But you give me a great idea. Because Python has
a module called PythonWin which allow Python to be
registered as a COM server so I will try to write
Python scripts server callable by xpp

> i try to to read
> Kraig Brockschmidt - Inside Ole, Second Edition
> ... it is hard Stuff (1194 pages)

really!
too big for me...

Best regards
Claudio