Windows Tablet RealTimeStylus in Python

Damon damonwischik at gmail.com
Sat Jan 17 17:08:32 EST 2009


I have a Windows Tablet machine, running XP Tablet Edition, and I want
to access the stylus data from Python.

If anyone has done this themselves, I'd be very grateful for a
description of what worked.

Otherwise, I'd be grateful for advice. I'm in way over my head, so
what I describe below is probably full of errors.

I managed to access the stylus data successfully from C#, using a .net
object called RealTimeStylus, contained in Microsoft.Ink.dll, which
was located in
c:\program files\common files\microsoft shared\ink.

The documentation says that this .net object uses an underlying COM
object, so I hoped to be able to access the COM object from within
Python. First, I used a .net disassembler to inspect
Microsoft.Ink.dll, and I discovered that it uses this command to
create the COM object:
Guid clsid = new Guid("{DECBDC16-E824-436e-872D-14E8C7BF7D8B}");
Guid iid = new Guid("{C6C77F97-545E-4873-85F2-E0FEE550B2E9}");
string licenseKey = "{CAAD7274-4004-44e0-8A17-D6F1919C443A}";
ComObjectCreator.CreateInstanceLicense(clsid, iid, licenseKey);

I looked up this clsid in my registry, and discovered that it refers
to
C:\Program Files\Common Files\Microsoft Shared\INK\inkobj.dll
(This file also exists on my standard XP machine, which also ran my C#
program happily.)

Now, I want to somehow access this COM object from within Python. I
tried MakePy, but I didn't know what type library to specify. I found
something called "Microsoft Tablet PC Type Library, version 1.0
(1.0)", and it generated a .py file from type library 'inkobj.dll',
but this file doesn't say anything about a RealTimeStylus.

I tried looking for a Python command to CreateInstance, but I couldn't
find one where I could specify the license string. Without the license
string I ended up with the error message "Class is not licensed for
use".

I have no idea what to do next.

Damon.



More information about the Python-list mailing list