Hello again, This is going to be the last one I hope....
Further to my previous post, I managed to have the mitab dll and contributed c# classes in a different project and be used as a dependency to a main project. Apparently it has to do with build options that I am not familiar yet with. If the sub project is declared as a C# Class library then it does not work, i.e the exception about mitab.dll not exporting a or b method is thrown. If however we create a c# console application and we treat it as a library i.e disregard its main class and invoke the contrib classes from the main project, everything works as a charm. So I guess there is a build setting in the Console Application that is mandatory to be set also if the project is a C# class library. Thanks for all our help Yiannis --- In [email protected], "Ioannis" <janagn0@...> wrote: > > Hello Anthony, > > Did some more work on it. The dll is working fine if you include it in the > project you are working. The reason it was failing was because I tried to > have it in a separate project that was included as dependency in my main > project. I must be missing some kind of export option in the later case > although I can see the dll being copied in my debug/release folder of the > main project. If you could provide any help it will be much appreciated. > > Kind Regards > Yiannis > > --- In [email protected], Anthony Dunk <anthonyd@> wrote: > > > > Hi Yiannis, > >  > > Have you tried using Visual Studio's Dependency Viewer tool on the DLL to > > check that the function you're calling in the DLL is exposed in its > > interface ? > >  > > I am building Mitab using VS2010 to create a DLL and this is callable from > > C#. I have included an extremely simple C# program to connect to the Mitab > > DLL and display the version number below (It shows 2000000 in my case). > >  usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;using > > ãSystem.Runtime.InteropServices;namespace > > {GetMitabLibVersionclassProgram{ > > [ > > { > > s = nVersion.ToString(); > > } > > } > > } > >  > > Anthony.DllImport("mitab.dll")]publicstaticexternintmitab_c_getlibversion();staticvoidMain(string[] > > args)strings;intnVersion = > > mitab_c_getlibversion();Console.WriteLine(s);stringline = > > Console.ReadLine(); > > > > > > ________________________________ > > From: Ioannis <janagn0@> > > To: [email protected] > > Sent: Tuesday, 15 November 2011 10:23 PM > > Subject: [mitab] EntryPointNotFoundException > > > > > >  > > Hi all, > > > > I compiled the mitab.dll 1.7.0 as advised using VisualStudio2010 tools from > > the command line. My machine is running win7 64bit but I don't think that > > this causes any issue at this stage. Then I created a C# project copied the > > dll and the contributed classes. Unfortunately any call to the mitab > > functions returns an EntryPointNotFoundExeption. Has anybody achieved to > > use the unmanaged dll 1.7.0 to a c# project? > > > > Thanks in advance > > Yiannis > > > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/mitab/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/mitab/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
