<br><font size=2 face="sans-serif">Conny:  </font>
<br>
<br><font size=2 face="sans-serif">It's been a while since I did anything
with PocketPC, so I don't remember all the differences between .NET on
it versus full Windows.  But ... regarding the shapelib.dll -- it
dos not need to be included in your Visual Studio project; it just needs
to reside in a place the your assembly can find it (typically, the same
directory -- which is exactly where the post build event puts it).  Copying
it there manually, as you did, accomplishes the same thing.  Shapelib.dll
gets called at runtime.  It does not become part of the .net assembly,
so your Visual Studio solution ReadArcShape needs no reference to it at
all.  It only needs shapelib.dll at runtime. </font>
<br>
<br><font size=2 face="sans-serif">Secondly, the version of shapelib.dll
on MapTools.org is compiled for windows, so you will need to recompile
it for Windows CE.  The C/C++ source and VS projects should be out
on the Shapelib site.  That should be possible since there is nothing
exotic or windows-specific about the shapelib c code.  </font>
<br>
<br><font size=2 face="sans-serif">Finally, I wouldn't  think you
will need to revisit the PInvoke calls in the .net wrapper.  As I
recall the Compact Framework supports PInvoke -- although you might want
to check the details on that.  </font>
<br>
<br><font size=2 face="sans-serif">I hope some of this helps, and good
luck.</font>
<br>
<br><font size=2 face="sans-serif">David Gancarz</font>
<br>
<br><font size=2 face="sans-serif">----------------------------------------<br>
Florida has a very broad public records law.  As a result, any written
communication created or received by City of Orlando officials and employees
will be made available to the public and media, upon request, unless otherwise
exempt.  Under Florida law, email addresses are public records.  If
you do not want your email address released in response to a public records
request, do not send electronic mail to this office.  Instead, contact
our office by phone or in writing.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>"Constanze Tschritter"
<Conny3@gmx.de></b> </font>
<br><font size=1 face="sans-serif">Sent by: shapelib-bounces@lists.maptools.org</font>
<p><font size=1 face="sans-serif">02/26/2007 01:02 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Shapelib Development <shapelib@lists.maptools.org></font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">shapelib@lists.maptools.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[Shapelib] Shapelib.dll PInvoke error</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Dear List,<br>
<br>
When I tried to compile my Pocket PC 2003 project, the result was a MissingMethodException
saying the entry point SHPopen within the PInvoke DLL shapelib.dll was
not found (I¡¦ve got the german version of Visual studio 8, but this is
more or less what it said). <br>
<br>
Here is the offending code snippet:<br>
<br>
Const STRSHAPEPATH As String = "xxx\\xxx\\strassen.shp"<br>
<br>
Private Sub ReadArcShape()<br>
        Dim myShapeType As ShapeLib.ShapeType = ShapeLib.ShapeType.PolyLine<br>
        Dim hShape As IntPtr = New IntPtr()<br>
        Dim intNum As Integer = 0<br>
        Dim dblMinBounds As Double() = New Double(1)
{0, 0}<br>
        Dim dblMaxBounds As Double() = New Double(1)
{0, 0}<br>
<br>
'At this point I get the MissingMethodException<br>
hShape = ShapeLib.SHPOpen(STRSHAPEPATH, "rb")<br>
¡K<br>
End Sub<br>
<br>
Looking up that error message at the internet I found some possible causes
for the error but until now, nothing I tried changed anything: <br>
<br>
„³ 1) Platform:  I downloaded the Shapelib .Net Wrapper by David
Gancarz and recompiled the shapelib for Pocket-PC 2003. However I got an
error message, when I tried to use the same shapelib files he did. Thus
I used a windows ce shapelib package which had been assembled by Mateusz
Loskot and was able to compile those without problems. The only difference
I noticed was, that this package contained more files than David Gancarz
had used. <br>
<br>
A test with<br>
<br>
¡§Dumpbin /header shapefile.dll |find ¡§machine¡¨¡¨ resulted in <br>
                
<br>
                
¡§1C0 machine(ARM)¡¨ so I must have done something right. <br>
<br>
Afterwards I tried to recompile the Maptools-Project (which is said wrapper
project), now with the new shapelib.dll. The only error message I got was
that the post build event copy $(ProjectDir)shapelib.dll  $(TargetDir)
had failed, so I copied it manually into my project folder. I¡¦m not sure
if that was the right thing to do, because I don¡¦t know the background
behind this.<br>
<br>
I added the maptools.dll reference to my project, but got an error, when
I tried the same with the shapelib (¡§Unable to add reference to Shapelib.dll¡¨).
Do I even have to add that, too, or is sufficient to only add the maptools.dll?
Well everything seemed to be ok, though, Visual studio recognized the Shapelib
functions. <br>
<br>
„³ 2) Build Action: I set the build action of the shapelib.dll in my project
to content, but nothing changed.<br>
<br>
„³ 3) PInvoke: I thought with the .Net wrapper I won¡¦t have to worry
about PInvoke.(?)<br>
<br>
I don¡¦t know what else to do. I must have missed something, but I don¡¦t
know what. Maybe someone here can give me a hint what I¡¦m doing wrong.
Thank you very much in advance!<br>
<br>
Cheers<br>
Constanze Tschritter<br>
<br>
PS: Sorry for the long mail. I didn't know how to describe it in a shorter
way.<br>
<br>
<br>
-- <br>
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! <br>
Ideal fur Modem und ISDN: http://www.gmx.net/de/go/smartsurfer<br>
_______________________________________________<br>
Shapelib mailing list<br>
Shapelib@lists.maptools.org<br>
http://lists.maptools.org/mailman/listinfo/shapelib<br>
</tt></font>
<br>