I think I might prefer to do that: compile and link all mitab
modules with my own code. That way it's somewhat understandable.
I'm starting with a simple test program... see below. Now I find I
have to include many (possibly all) mitab related .cpp and .h
modules. Would it be easier to start developing all my programs in
the same folder as all the mitab modules, and somehow mass-add all
the .cpp and .h modules to my project? I am already needing to use
things from multiple folders "mitab" as well as folder "cpl"... so I
would have to tell the compiler to gather modules from lots of
places.
Project -> Add New Item - creates a file containing C++ source code -
I can then copy-and-paste existing .cpp contents to this blank
text window. For each source module. This seems extremely tedious.
Is there no simple "import", or "add existing .cpp" ? Add ALL.
#include "stdafx.h"
#include <stdlib.h> // exit()
#include <conio.h> // _getch()
#include <errno.h>
#include "mitab_capi.h"
#include "windows.h"
mitab_handle mh;
int main(int argc, char* argv[])
{
printf("test\n");
mh = mitab_c_create("test.tab", NULL, NULL, 0, 0, 0, 0);
if (NULL == mh) {
printf("Invalid handle.\n");
_getch(); }
else {
printf("ok\n");
_getch(); }
printf("finished\n");
_getch();
return 0;
}
--- In [email protected], Anthony Dunk <[EMAIL PROTECTED]> wrote:
>
> Â
> Yes, there does not seem to be a .lib file in the distribution.
The only way I know of to use the DLL in this case is to use
LoadLibrary() calls to access each function. (Although I could be
wrong). Here's how to do this:
> Â
>
> HINSTANCE hInst = LoadLibrary("mitab.dll");
> if (hInst==0)
> {
> Â Â Â AfxMessageBox("Could not load mitab.dll!");
> }
> else
> {
> FARPROC fp_mitab_c_getlibversion = GetProcAddress
(hInst,"[EMAIL PROTECTED]");
> int (*mitab_c_getlibversion)(/*args*/) = (int (*)(/*args*/))
fp_mitab_c_getlibversion;
> int nVersion = mitab_c_getlibversion();
> CString s;
> s.Format("Mitab version = %d",nVersion);
> AfxMessageBox(s);
> }Personally I use a version of Mitab that I built myself from the
source files - this is another option for you.
> Â
> Cheers,
> Anthony.
>
> Â
> Â
>
>
> --- On Tue, 25/11/08, skahrkling <[EMAIL PROTECTED]> wrote:
>
> From: skahrkling <[EMAIL PROTECTED]>
> Subject: [mitab] Re: how to get mitab_c_create() etc. to link
to .dll
> To: [email protected]
> Received: Tuesday, 25 November, 2008, 2:49 PM
>
>
>
>
>
>
> Thank you for your help so far.
>
> I added Project -> Properties -> Configuration Properties ->
Linker -
> > Input -> Additional Dependencies -> mitab.dll
>
> Now I get even more cryptic:
> mitab.dll : fatal error LNK1107: invalid or corrupt file: cannot
> read at 0x280
>
> Looking for info on that error I see:
> "LNK1107 could also occur if you attempt to pass a module (.dll
> or .netmodule extension created with /clr:noAssembly
or /NOASSEMBLY)
> to the linker; pass the .obj file instead.
>
> I'd be happy to pass .obj instead, if I had one. But that may not
be
> the cause.
>
> Also you mentioned that I should add a path to the LIB file. There
> is no lib file in the mitab-1.7.0- win32 package. There is a
mention
> of compiling the library in the README.TXT. Is that what I need? I
> don't find any makefiles - although that section seems to be
catered
> more to VB (nmake -f makefile.vc)
>
> Sorry I need more hand-holding.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Start your day with Yahoo!7 and win a Sony Bravia TV. Enter
now http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
>
------------------------------------
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:
mailto:[EMAIL PROTECTED]
mailto:[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/