2005.05.27 21:47 "Re: [Tiff] creating a vb wrapper for libtiff", by Antoine
I have searched high and low for one of these but have neither been able to find one (lots of dead links in the archives), nor been able to work out how to do it (never really worked with apis before). If anyone has one, could they post it to the list? That way it would get archived and fewer people would post this foolish question! A link to a good tutorial (or script that will do most of the work for me), and the appropriate headers to convert would be another option...
If you compile the library with gcc on Windows (using MinGW, Cygwin, or other), you need to include the -mstd (I think) option to use the Pascal stack convention. You can then use one of the included tools (can't remember which) to generate a DLL from the .a file(s). Then, you just need to come up with the Declare statements to get VB to interface to the DLL. I have examples of this for work. I used GNU fortran to compile some code for a code worker and generate a DLL from use by some Excel VBA macros. I can send you the steps needed, but it will have to wait for Tuesday ---- It's all at work.
That would be great thanks. Basically there are only a few functions I need. The low-level tag stuff I do myself (adding, removing, rearranging the contents of the file, etc.), and most of the higher level stuff I will be using libtiff via freeimage via a freeimage ocx, but I need to be able to do certain things that freeimage can't/won't do, like specifying the size of strips.
I am using the gnuwin32 3.7.2 dll, and it seems to be ok, at least for TIFFGetVersion :-). I will try to have a another look at tiffcp for the functions I need and do them myself, but I am sure to do things ugly, so please send it to me anyway.
G System, The Evolving GUniverse - http://www.g-system.at