[Shapelib] I have the dll compiled but know I have to make it works in the emulator.

Daniel de la Cuesta cues7a at yahoo.es
Sun Aug 27 10:19:13 PDT 2006


Don´t worry about my previous question because It´s solved. I have been trying and I got the solution.
  
  I had to change somethings in the C code:
  
  1.- I had to define DLL export:
  #define DLL_EXPORT __declspec(dllexport)
  
  2.- Declare each method that is accesed from outside lik
  DLL_EXPORT void Method ()
  
  Now when i do: dumpbin shapelib.dll /EXTERNS I got the extern methods.
  
  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:
  
  IntPtr hDbf = ShapeLib.DBFCreate(FILENAME);
  int iRet = ShapeLib.DBFAddField(hDbf, "id", ShapeLib.DBFFieldType.FTInteger, 5, 0);
               iRet = ShapeLib.DBFAddField(hDbf, "texto",  ShapeLib.DBFFieldType.FTString, 10, 0);
               iRet = ShapeLib.DBFAddField(hDbf, "double",  ShapeLib.DBFFieldType.FTDouble, 11, 0);
               iRet = ShapeLib.DBFAddField(hDbf, "boolean",  ShapeLib.DBFFieldType.FTLogical, 5, 0);
  
  
  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.
  
  For example: I get a "t.dbf" file (instead of "test.dbf").
  I want a field called "stringField" but I only get a field called "s"
  I want a field called "doubleField" but I only get a field called "d"
  
  What´s happening? Anyone know something about that?
  
  Thank you.
  
  
Daniel de la Cuesta <cues7a at yahoo.es> escribió:  Hi Mateusz,
  
  I am Daniel, I have been studying how to import a Dll with PInvoke
  from Compact Framework.
  
  
  > Please, confirm this checklist (though, there are more issues possible):
  
  > 1. Your DLL is indeed compiled for Pocket PC and correct CPU
  > architecture, but not for desktop
  That´s ok. I have my dll compiled for Pocket Pc. Your e-mails have been very helpfull to do that.
  
  > 2. You've deployed (tricky, may not work with DLL) or manually uploaded
  > your shapefile.dll file to the mobile device, into directory where is
  > your .NET CF application .exe file.
  
  Ok.
  
  > If you want to deploy DLL automatically, follow these steps:
  > 1. Right click on your .NET CF app project in the solution explorer
  > 2. Choose Add/Existing Item
  > 3. Navigate to your shapefile.dll
  > 4. Select this file in the solution explorer.
  > 5. Change "Build   Action" to "Content"
  
  Ok.
  
  > Note, that after your DLL is uploaded on the device or emulator,
  > File Explorer won't show it in directory listings because DLLs are
  > hidden by default.
  > So, enable "Show all files" to see it.
  
  Ok.
  
  When I deploy my application in the emulator I get the following
  exception during the execution:
  
  "Can't find an Entry Point 'DBFCreate' in a PInvoke DLL
  'shapelib2.dll'."
  
  
  I have done "dumpbin shapelib.dll /EXPORTS" in the VS2005 command line and I get the following result:
  
    
Section contains the following exports for shapelib.dll
  
    
 00000000 characteristics
    44EE10C5 time date stamp Mon Apr 24 22:02:37 2006
        0.00 version
           1 ordinal base
           0 number of functions
    0 number of names 
           1 number of names

That thing means that shapelib.dll has no external 
functions I can use.

I think I have to declare the methods I am going
to use like extern in the C code.

What do you think?
I am no good with C code, can you tell me how to do it?
Do I have to declare them like
 extern in the prototypes?

Can you help me? 
 



  
  
  
  
  -- 
  Saludos,
   Daniel                             mailto:cues7a at yahoo.es
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
       

---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com_______________________________________________
Shapelib mailing list
Shapelib at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/shapelib


 		
---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/shapelib/attachments/20060827/b4b25dbe/attachment.html>


More information about the Shapelib mailing list