Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34130

Re: Help accessing COM .dll from Python

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; '(even': 0.05; 'defines': 0.07; 'api': 0.09; 'python': 0.09; '"if': 0.09; 'happens.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Help': 0.10; 'suggest': 0.11; 'received:141': 0.13; ':-)': 0.13; 'steve': 0.13; '(but': 0.15; 'tutorials': 0.15; '.dll': 0.16; 'gentle': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sdk': 0.16; 'subject:accessing': 0.16; 'documented': 0.17; 'pointer': 0.17; 'examples': 0.18; 'load': 0.19; 'trying': 0.21; 'bit': 0.21; 'java': 0.21; 'ctypes': 0.22; 'friend.': 0.22; "i'd": 0.22; "i've": 0.23; 'seems': 0.23; 'cheers': 0.24; 'idea': 0.24; 'device': 0.24; 'paul': 0.24; 'script': 0.24; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'interface': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'post': 0.28; 'implies': 0.29; 'covered': 0.29; 'probably': 0.29; 'install': 0.29; 'call.': 0.30; 'url:python': 0.32; 'file': 0.32; 'could': 0.32; 'explains': 0.33; 'subject: .': 0.33; 'to:addr:python-list': 0.33; 'excel': 0.33; 'hi,': 0.33; 'text': 0.34; 'described': 0.35; 'direction': 0.35; 'expected': 0.35; 'there': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'option': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'some': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'application': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'first': 0.61; 'more': 0.63; 'here': 0.65; 'hints': 0.65; 'started.': 0.65; 'excellent.': 0.84; 'headed': 0.84; 'concluded': 0.91; 'don\xe2\x80\x99t': 0.91; 'device.': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Paul Kölle <paul@subsignal.org>
Subject Re: Help accessing COM .dll from Python
Date Sun, 02 Dec 2012 01:45:20 +0100
References <50B9D306.5080508@gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 141.43.79.246
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/17.0 Thunderbird/17.0
In-Reply-To <50B9D306.5080508@gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.407.1354409137.29569.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1354409137 news.xs4all.nl 6940 [2001:888:2000:d::a6]:36377
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34130

Show key headers only | View raw


Hi,

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 http://docs.python.org/2/library/ctypes.html and call some 
functions documented in "VC SDK.pdf" and see what happens. The defines 
for return codes used in the documentation are here 
http://www.id-reader.com/Support/Sample_Codes/Visual_C_Plus_Plus/header_lib.rar 
in SlibErrDef.h and probably others...

cheers
  Paul

>
> 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
>
>
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Help accessing COM .dll from Python Paul Kölle <paul@subsignal.org> - 2012-12-02 01:45 +0100

csiph-web