Don´t worry about my previous question because It´s solved. I have been trying and I got the solution.<br> <br> I had to change somethings in the C code:<br> <br> 1.- I had to define DLL export:<br> <span style="font-style: italic;">#define DLL_EXPORT __declspec(dllexport)</span><br> <br> 2.- Declare each method that is accesed from outside lik<br> <span style="font-style: italic;">DLL_EXPORT void Method ()<br> <br> <span style="font-style: italic;"><span style="font-style: italic;"></span></span></span>Now when i do: <span style="font-style: italic;">dumpbin shapelib.dll /EXTERNS</span> I got the extern methods.<br> <br> I am trying a test app that uses shapelib.dll and I have a problem. I want to create a new DBF. So I use the DBFCreate function. Then i add some fields. I do something like that:<br> <br> <span style="font-style: italic;">IntPtr hDbf = ShapeLib.DBFCreate(FILENAME);</span><br style="font-style: italic;"> <span style="font-style:
italic;">int iRet = ShapeLib.DBFAddField(hDbf, "id", ShapeLib.DBFFieldType.FTInteger, 5, 0);</span><br style="font-style: italic;"> <span style="font-style: italic;"> iRet = ShapeLib.DBFAddField(hDbf, "texto", ShapeLib.DBFFieldType.FTString, 10, 0);</span><br style="font-style: italic;"> <span style="font-style: italic;"> iRet = ShapeLib.DBFAddField(hDbf, "double", ShapeLib.DBFFieldType.FTDouble, 11, 0);</span><br style="font-style: italic;"> <span style="font-style: italic;"> iRet = ShapeLib.DBFAddField(hDbf, "boolean", ShapeLib.DBFFieldType.FTLogical, 5, 0);</span><br> <br> <br> Everything is Ok, I get a dbf archive with the fields I want. Well, almost everything because I only get the first letter of each field and the first letter of the file.<br> <br> For
example: I get a "t.dbf" file (instead of "test.dbf").<br> I want a field called "stringField" but I only get a field called "s"<br> I want a field called "doubleField" but I only get a field called "d"<br> <br> What´s happening? Anyone know something about that?<br> <br> Thank you.<br> <br> <br><b><i>Daniel de la Cuesta <cues7a@yahoo.es></i></b> escribió:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi Mateusz,<br> <br> I am Daniel, I have been studying how to import a Dll with PInvoke<br> from Compact Framework.<br> <br> <br> > Please, confirm this checklist (though, there are more issues possible):<br> <br> > 1. Your DLL is indeed compiled for Pocket PC and correct CPU<br> > architecture, but not for desktop<br> That´s ok. I have my dll compiled for Pocket Pc. Your e-mails have been very helpfull to do that.<br> <br> > 2. You've deployed (tricky, may not work with
DLL) or manually uploaded<br> > your shapefile.dll file to the mobile device, into directory where is<br> > your .NET CF application .exe file.<br> <br> Ok.<br> <br> > If you want to deploy DLL automatically, follow these steps:<br> > 1. Right click on your .NET CF app project in the solution explorer<br> > 2. Choose Add/Existing Item<br> > 3. Navigate to your shapefile.dll<br> > 4. Select this file in the solution explorer.<br> > 5. Change "Build Action" to "Content"<br> <br> Ok.<br> <br> > Note, that after your DLL is uploaded on the device or emulator,<br> > File Explorer won't show it in directory listings because DLLs are<br> > hidden by default.<br> > So, enable "Show all files" to see it.<br> <br> Ok.<br> <br> When I deploy my application in the emulator I get the following<br> exception during the execution:<br> <br> <span style="font-style: italic;">"Can't find an Entry Point 'DBFCreate' in a PInvoke
DLL</span><br style="font-style: italic;"> <span style="font-style: italic;">'shapelib2.dll'."<br> <span style="font-style: italic;"></span><br> </span><br> I have done <span style="font-style: italic;">"dumpbin shapelib.dll /EXPORTS"</span> in the VS2005 command line and I get the following result:<span style="font-style: italic;"><br> <br> </span> <pre style="font-style: italic;">Section contains the following exports for shapelib.dll</pre> <br style="font-style: italic;"> <pre><span style="font-style: italic;"> 00000000 characteristics</span><br style="font-style: italic;"><span style="font-style: italic;"> 44EE10C5 time date stamp Mon Apr 24 22:02:37 2006</span><br style="font-style: italic;"><span style="font-style: italic;"> 0.00 version</span><br style="font-style: italic;"><span style="font-style: italic;"> 1 ordinal base</span><br style="font-style: italic;"><span style="font-style: italic;"> 0 number of functions</span><br
style="font-style: italic;"><span style="font-style: italic;"> 0 number of names </span><br style="font-style: italic;"><span style="font-style: italic;"> 1 number of names</span><br><br>That thing means that shapelib.dll has no external <br>functions I can use.<br><br>I think I have to declare the methods I am going<br>to use like extern in the C code.<br><br>What do you think?<br>I am no good with C code, can you tell me how to do it?<br>Do I have to declare them like<br> extern in the prototypes?<br><br>Can you help me? <br> <br><br><br></pre> <br> <br> <br> <br> -- <br> Saludos,<br> Daniel mailto:cues7a@yahoo.es<br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
<br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <div> </div><hr size="1"><br><font face="Verdana" size="-2">LLama Gratis a cualquier PC del Mundo.<br>Llamadas a fijos y móviles desde 1 céntimo por minuto.<br><a href="http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/">http://es.voice.yahoo.com</a></font>_______________________________________________<br>Shapelib mailing list<br>Shapelib@lists.maptools.org<br>http://lists.maptools.org/mailman/listinfo/shapelib<br></blockquote><br><p> 
                <hr size=1><br><font face="Verdana" size="-2">LLama Gratis a cualquier PC del Mundo.<br>Llamadas a fijos y móviles desde 1 céntimo por minuto.<br><a href="http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/">http://es.voice.yahoo.com</a></font>