Question: run time error using a native lib

  • Thread starter Thread starter Ladvánszky Károly
  • Start date Start date
L

Ladvánszky Károly

I'm trying to use a statically linked C library. I've wrapped a .NET C++ DLL
around this lib and trying to drive the wrapper from a .NET VB testbed. The
whole build succeeds but I get the following error message at runtime:

An unhandled exception of type 'System.TypeLoadException' occurred in
TiffLibXTester.exe

Additional information: Could not load type tiff from assembly TiffLibX,
Version=1.0.1425.19884, Culture=neutral, PublicKeyToken=null.

I would appreciate any help on this and in general, on what the best way is
to use legacy libraries (either lib or dll) from .NET.

Thanks,

Ladvánszky Károly
 
it's probably forward declared as
struct tiff;
What you need to do in MC++ is:
struct tiff{};
 
Thanks for your answer.
Where should I place it in MC++? Everything compiles and links with no
problem.

Károly
 
To my surprise, it has worked. I have the source files of the library in
question and struct tiff is declared.
What does this empty struct declaration do?
Could you please explain the solution a little more detailed?
Is it MC++ specific?

Thanks,

Károly
 
Back
Top