Re: Calling and executing ArcGIS extension .dll inPython [SEC=PERSONAL]

"Andrew MacIntyre" <[email protected]>
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
I can't find the user manual referenced in AS13910, which makes it hard
to help.

 

Your setting up of the parameters (hllapiparams) to the hllapiproto()
call doesn't match the ctypes documentation as to how this information
needs to be structured.

 

 

-------------------------> "These thoughts are mine alone!" <---------

Andrew MacIntyre           Operations Branch

tel:   +61 2 6219 5356     Communications Infrastructure Division

fax:   +61 2 6253 3277     Australian Communications & Media Authority

email: [email protected]
<mailto:[email protected]>
http://www.acma.gov.au/ <http://www.acma.gov.au/> 

 

From: David Shi [mailto:[email protected]] 
Sent: Wednesday, 9 June 2010 1:57 AM
To: [email protected]
Subject: Re: [ctypes-users] ctypes-users Digest, Vol 49, Issue 2

 

http://arcscripts.esri.com/scripts.asp?eLang=&eProd=&perPage=10&eQuery=a
real&Submit2=Search
<http://arcscripts.esri.com/scripts.asp?eLang=&eProd=&perPage=10&eQuery=
areal&Submit2=Search> 

 

 

I have been trying to call and execute the ArcView 9.x one.

 

from ctypes import *

import ctypes

import arcgisscripting

gp = arcgisscripting.create()

 

# Load required toolboxes...

gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolBox/Toolboxes/Data
Management Tools.tbx")

 

mylib = CDLL("d:\\SHImaps\AS13910\ArealInterpolator.dll")

 

 

from ctypes.wintypes import HWND, LPCSTR, UINT

prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, UINT)

addr = mylib._handle

myfunc = prototype(addr)

 

# Make a layer from the feature class

gp.MakeFeatureLayer("d:/shimaps/lc_2k.shp","lyr1") 

# Make a layer from the feature class

gp.MakeFeatureLayer("d:/shimaps/lc_2k.shp","lyr2") 

 

# Select all cities which overlap the chihuahua polygon

gp.SelectLayerByLocation("lyr2", "intersect", "lyr1")

 

 

hllapiparams = ("lyr1"), ("area"), ("lyr2"), ("lyr2")

 

hllapiproto = ctypes.WINFUNCTYPE(ctypes.c_ulong, ctypes.c_char_p,
ctypes.c_char_p, ctypes.c_ulong)

 

hllapi = hllapiproto((1, mylib), hllapiparams)

 

##hllapi = hllapiproto(("1", mylib), hllapiparams)

 

##hllapi = hllapiproto((1, mylib), hllapiparams)

 

The error message says number of parameters not correct.

 

I wonder how to set up prototypes and parameters to call and execute vb
.dll.

 

Regards.

 


If you have received this email in error, please notify the sender immediately and erase all copies of the email and any attachments to it. The information contained in this email and any attachments may be private, confidential and legally privileged or the subject of copyright. If you are not the addressee it may be illegal to review, disclose, use, forward, or distribute this email and/or its contents.
 
Unless otherwise specified, the information in the email and any attachments is intended as a guide only and should not be relied upon as legal or technical advice or regarded as a substitute for legal or technical advice in individual cases. Opinions contained in this email or any of its attachments do not necessarily reflect the opinions of ACMA.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo

_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.