473,473 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question: run time error using a native lib

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
Nov 16 '05 #1
5 1510
it's probably forward declared as
struct tiff;
What you need to do in MC++ is:
struct tiff{};

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
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

Nov 16 '05 #2
Thanks for your answer.
Where should I place it in MC++? Everything compiles and links with no
problem.

Károly

"Pent" <pent> az alábbiakat írta a következő hírüzenetben:
#5*************@TK2MSFTNGP11.phx.gbl...
it's probably forward declared as
struct tiff;
What you need to do in MC++ is:
struct tiff{};

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
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


Nov 16 '05 #3
anywhere

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answer.
Where should I place it in MC++? Everything compiles and links with no
problem.

Károly

"Pent" <pent> az alábbiakat írta a következő hírüzenetben:
#5*************@TK2MSFTNGP11.phx.gbl...
it's probably forward declared as
struct tiff;
What you need to do in MC++ is:
struct tiff{};

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
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



Nov 16 '05 #4
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
"Pent" <pent> az alábbiakat írta a következő hírüzenetben:
e6**************@TK2MSFTNGP11.phx.gbl...
anywhere

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answer.
Where should I place it in MC++? Everything compiles and links with no
problem.

Károly

"Pent" <pent> az alábbiakat írta a következő hírüzenetben:
#5*************@TK2MSFTNGP11.phx.gbl...
it's probably forward declared as
struct tiff;
What you need to do in MC++ is:
struct tiff{};

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
> 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
>
>



Nov 16 '05 #5
Forward declarations prevent MC++ compiler from generating "metadata" for
these types.

http://www.winterdom.com/mcppfaq/archives/000262.html
http://groups.google.com/groups?selm...ngxa06.phx.gbl

search: groups.google.com
for: TypeLoadException group:microsoft.public.dotnet.languages.vc.*

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:ei**************@TK2MSFTNGP10.phx.gbl...
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
"Pent" <pent> az alábbiakat írta a következő hírüzenetben:
e6**************@TK2MSFTNGP11.phx.gbl...
anywhere

"Ladvánszky Károly" <lk@digicart.hu> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answer.
Where should I place it in MC++? Everything compiles and links with no
problem.

Károly

"Pent" <pent> az alábbiakat írta a következő hírüzenetben:
#5*************@TK2MSFTNGP11.phx.gbl...
> it's probably forward declared as
> struct tiff;
> What you need to do in MC++ is:
> struct tiff{};
>
> "Ladvánszky Károly" <lk@digicart.hu> wrote in message
> news:%2***************@TK2MSFTNGP09.phx.gbl...
> > 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
> >
> >
>
>



Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tim Mulholland | last post by:
Hello all, Our company is trying to write some code in C#/.NET that we don't want an end user to be able to see. The algorithms are not that complex, but are sensitive such that if a user could...
5
by: Dan | last post by:
Hi Gurus I got a very basic question to ask: When a .NET exe (MSIL) is first run, the JIT-compiler will converts the IL into native codes so that it can executes on the current machine. my...
3
by: Michael | last post by:
The other day I was looking around in the GAC and I noticed some strange things. For startings, I don't see any Microsoft libraries that have a version number 1.1. I only see 1.0.5000 and...
16
by: Kenneth McDonald | last post by:
For unfortunate reasons, I'm considering switching back to Win XP (from OS X) as my "main" system. Windows has so many annoyances that I can only compare it to driving in the Bay Area at rush hour...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
7
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The...
26
by: Kevin Walzer | last post by:
....with a twist. I'm undertaking my first semi-substantial Python GUI application after a long time dabbling with the language. I'm fairly experienced with Tcl/Tk, so Tkinter seems the...
11
by: hammad.awan_nospam | last post by:
Hello, I'm wondering if it's possible to do the following with Generics: Let's say I have a generic member variable as part of a generic class like this: List<DLinqQuery<TDataContext>>...
0
by: ChopStickr | last post by:
I have a custom control that is embedded (using the object tag) in an html document. The control takes a path to a local client ini file. Reads the file. Executes the program specified in...
14
by: ablock | last post by:
I have an array to which i have a added a method called contains. I would like to transverse this array using for...in...I understand fully that for...in is really meant for Objects and not Arrays,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.