Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Help accessing COM .dll from Python

Thread Tools

Re: Help accessing COM .dll from Python

Paul Kölle
Posts: n/a

Am 01.12.2012 10:51, schrieb Steve Simmons:
> First time post - be gentle with me
> I am trying to write a Python script to access a scanning device. I have an SDK
> for the scanner but the documentation is a bit limited and the supplier doesn't
> support Python (but Python is the best option for me in the current circumstances).

From a quick view it seems the documentation is excellent. There are
tons of examples (even Java so you could use jython), API documents and
the SDK. The "VC SDK.pdf" from the API documents zip explains what
functions are there and how to call them. I have no idea why you used
PEExplorer, are you using a device not covered by Slib.dll?
Anyway, I suggest you forget about COM and try to load Slib.dll via
ctypes and call some
functions documented in "VC SDK.pdf" and see what happens. The defines
for return codes used in the documentation are here
in SlibErrDef.h and probably others...


> The SDK revolves around a .dll file that is described as a 'COM Object' but the
> text also implies that it can be accessed directly - "If you don’t use the COM
> interface in your application and use the SDK files directly like in VC++ then
> you don’t need to install these files on the destination computer". If I look
> inside the .dll (thanks PEExplorer!), I see DllCanUnload, DllGetClassObject,
> DllRegisterServer and DllUnregisterServer in the 'Export' view. If I look at
> the 'Import' view, I can see the names of a bunch of .dll files and the names of
> the functions/methods I want to call. So I concluded that DllGetClassObject
> would be my friend.
> However, I've read various tutorials on using .dll and COM (ctypes, comtypes,
> and the Python documentation) and I've ended up more confused than when I
> started. I expected to be using COM but all the examples seem to revolve around
> automating excel or outlook.
> I'd be really grateful for some hints on what direction Ishould be headed and a
> pointer to a relevant tutorial.
> Simmo

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Help accessing COM .dll from Python Steve Simmons Python 0 12-01-2012 12:47 PM
Re: Help accessing COM .dll from Python Chris Angelico Python 0 12-01-2012 10:50 AM
Help accessing COM .dll from Python Steve Simmons Python 1 12-01-2012 10:42 AM
Accessing Twitter with Python (Python goes mainstream) Terry Reedy Python 0 04-22-2010 06:23 PM
Accessing members of Python class from C++ (Embedded Python)???? JM Python 2 08-28-2003 02:12 PM