
Thread
2005.05.31 20:01 "[Tiff] tiffopen problems continue...", by Antoine
Hi again,
I have decided that in spite of libtiff3.dll looking like it should be able to be called from vb as is, I would try to write a c++ wrapper that I could call that would in turn call the necessary functions. I thought at least it would stop vb crashing on me, no such luck. I have created a test dll that compiles, but when I put in the tiffopen I am back to square one. If I comment out the tiffopen/close lines then when I call the function from vb I get a message box with whatever I pass to it, no crashing, no warnings.
#include "stdafx.h"
#include "tiffio.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
int _stdcall mytest(const char* name, const char* mode)
{
LPSTR buffer;
buffer = (LPSTR)name;
TIFF* tif = TIFFOpen("C:\vbdev\fimage\lzw.TIF", "r");
//... do stuff ...
TIFFClose(tif);
::MessageBox(NULL,buffer,"in C++",0);
return 1;
When I uncomment the tiff lines vb just dies. It also dies if I create an exe. Any suggestions are warmly welcome.
Cheers
Antoine
G System, The Evolving GUniverse - http://www.g-system.at