473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Exception in C Library from .Net built VC++ Application

We have a strange error here.
We have an application that is built in VC++ 6.0 and uses a C library built
using the same. Now, we have migrated to .Net and have used the same source
code to be built using the new compiler.
What happens now is, that any call that we make to the C library(also built
in .Net Env now) from the VC++ Application(built in .Net now), falls prey to
a runtime exception and gets into our try catch block.
We are having hard time to get this guy out.
Any help will be appreciated.
Regards
Venky
Jul 21 '05 #1
5 1551
Perhaps if you supplied some details about the exception and the library
someone could provide some help.

"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
We have a strange error here.
We have an application that is built in VC++ 6.0 and uses a C library built using the same. Now, we have migrated to .Net and have used the same source code to be built using the new compiler.
What happens now is, that any call that we make to the C library(also built in .Net Env now) from the VC++ Application(built in .Net now), falls prey to a runtime exception and gets into our try catch block.
We are having hard time to get this guy out.
Any help will be appreciated.
Regards
Venky

Jul 21 '05 #2
Hi David,
Thanks for your response. Unfortunately its our own C library and as on date
I cannot reveal that for corporate rules.
However, I can give you more information.
Firstly, there is no specific exception code related to this.
Guess what if I have the same library built using VC++ 6.0 it works OK, but
when I build it with .Net it crashes.
Any clues?
Thanks
Venky
"David Levine" wrote:
Perhaps if you supplied some details about the exception and the library
someone could provide some help.

"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
We have a strange error here.
We have an application that is built in VC++ 6.0 and uses a C library

built
using the same. Now, we have migrated to .Net and have used the same

source
code to be built using the new compiler.
What happens now is, that any call that we make to the C library(also

built
in .Net Env now) from the VC++ Application(built in .Net now), falls prey

to
a runtime exception and gets into our try catch block.
We are having hard time to get this guy out.
Any help will be appreciated.
Regards
Venky


Jul 21 '05 #3
All you have told us is that something doesn't work without supplying any
details at all, not even what the exception is. What do you expect anyone to
do?

"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Hi David,
Thanks for your response. Unfortunately its our own C library and as on date I cannot reveal that for corporate rules.
However, I can give you more information.
Firstly, there is no specific exception code related to this.
Guess what if I have the same library built using VC++ 6.0 it works OK, but when I build it with .Net it crashes.
Any clues?
Thanks
Venky
"David Levine" wrote:
Perhaps if you supplied some details about the exception and the library
someone could provide some help.

"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
We have a strange error here.
We have an application that is built in VC++ 6.0 and uses a C library

built
using the same. Now, we have migrated to .Net and have used the same

source
code to be built using the new compiler.
What happens now is, that any call that we make to the C library(also

built
in .Net Env now) from the VC++ Application(built in .Net now), falls
prey to
a runtime exception and gets into our try catch block.
We are having hard time to get this guy out.
Any help will be appreciated.
Regards
Venky


Jul 21 '05 #4
Are you using a catch(...), just curious?

Are you calling WIN32 GetLastError()?

Are you getting it while in a debug session? If not try. If you can't then
collecting runtime information about the call stack.

There are many things you 'could' do as Mr. Levine pointed out.

"David Levine" <no****************@wi.rr.com> wrote in message
news:er**************@TK2MSFTNGP12.phx.gbl...
All you have told us is that something doesn't work without supplying any
details at all, not even what the exception is. What do you expect anyone
to
do?

"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Hi David,
Thanks for your response. Unfortunately its our own C library and as on

date
I cannot reveal that for corporate rules.
However, I can give you more information.
Firstly, there is no specific exception code related to this.
Guess what if I have the same library built using VC++ 6.0 it works OK,

but
when I build it with .Net it crashes.
Any clues?
Thanks
Venky
"David Levine" wrote:
> Perhaps if you supplied some details about the exception and the
> library
> someone could provide some help.
>
> "Venky" <Ve***@discussions.microsoft.com> wrote in message
> news:48**********************************@microsof t.com...
> > We have a strange error here.
> > We have an application that is built in VC++ 6.0 and uses a C library
> built
> > using the same. Now, we have migrated to .Net and have used the same
> source
> > code to be built using the new compiler.
> > What happens now is, that any call that we make to the C library(also
> built
> > in .Net Env now) from the VC++ Application(built in .Net now), falls prey > to
> > a runtime exception and gets into our try catch block.
> > We are having hard time to get this guy out.
> > Any help will be appreciated.
> > Regards
> > Venky
>
>
>



Jul 21 '05 #5
This only happens with a release build?

This sounds like a typical, difficult-to-debug unmanaged code problem. One
approach you can try is to compile the release build with debugging symbols
and load it up in a debugger. Set the debugger to break on 1st chance
exceptions. If an exception is actually getting thrown in the C++ code it
should break there. It may also be that the runtime is converting a return
value into an exception. There are a thousand possibilities, but without
more details it is impossible to say.
"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
I apologize. As I said this is a corporate code and I cannot reveal the
actuals. I know I am being very abstract and just defining a problem. My
curious hit was if someone else encountered a similar problem.
We are using catch(...). Inside this catch(...) even if I try to
GetLastError(), the only error code that I receive is 0. It does not happen in a debug session, however let me explain you some more about the history.
We had a C library called libdelta.lib, now we changed the directory
structure of this library and modified our vcproj file accordingly and it
builds. Also, we had this library as a static library in our application but now its an import library that refers to libdelta.dll.

Is there anything that this scenrio can derive?

Many Thanks,
Venky
"DM McGowan II" wrote:
Are you using a catch(...), just curious?

Are you calling WIN32 GetLastError()?

Are you getting it while in a debug session? If not try. If you can't then collecting runtime information about the call stack.

There are many things you 'could' do as Mr. Levine pointed out.

"David Levine" <no****************@wi.rr.com> wrote in message
news:er**************@TK2MSFTNGP12.phx.gbl...
All you have told us is that something doesn't work without supplying any details at all, not even what the exception is. What do you expect anyone to
do?

"Venky" <Ve***@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
> Hi David,
> Thanks for your response. Unfortunately its our own C library and as on date
> I cannot reveal that for corporate rules.
> However, I can give you more information.
> Firstly, there is no specific exception code related to this.
> Guess what if I have the same library built using VC++ 6.0 it works OK, but
> when I build it with .Net it crashes.
> Any clues?
> Thanks
> Venky
>
>
> "David Levine" wrote:
>
> > Perhaps if you supplied some details about the exception and the
> > library
> > someone could provide some help.
> >
> > "Venky" <Ve***@discussions.microsoft.com> wrote in message
> > news:48**********************************@microsof t.com...
> > > We have a strange error here.
> > > We have an application that is built in VC++ 6.0 and uses a C library> > built
> > > using the same. Now, we have migrated to .Net and have used the same> > source
> > > code to be built using the new compiler.
> > > What happens now is, that any call that we make to the C library(also> > built
> > > in .Net Env now) from the VC++ Application(built in .Net now), falls prey
> > to
> > > a runtime exception and gets into our try catch block.
> > > We are having hard time to get this guy out.
> > > Any help will be appreciated.
> > > Regards
> > > Venky
> >
> >
> >


Jul 21 '05 #6

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

Similar topics

42
by: cody | last post by:
public DateTime Value { get { try { return new DateTime(int.Parse(tbYear.Text), int.Parse(tbMonth.Text), int.Parse(tbDay.Text)); } catch (FormatException)
1
by: Paul Brun | last post by:
I have a library that is built in VC6 which contains references to the new iostream instead of "iostream.h" to accomodate my .NET Studio built C++ application. However, in debug mode, I obtain...
5
by: Venky | last post by:
We have a strange error here. We have an application that is built in VC++ 6.0 and uses a C library built using the same. Now, we have migrated to .Net and have used the same source code to be...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
6
by: TimThornton | last post by:
Hi, I have an applicationthat calls Application.Run from main, and this generates a FileNotFoundException. The solution has the main program and a number of DLLs, and it is saying that it cannot...
0
by: Herman Jones | last post by:
I'm getting the following error when I build a Class Library project: Embedding manifest... Project : error PRJ0002 : Error result 1 returned from 'C:\WINDOWS\system32\cmd.exe'. It happens with...
5
by: Bry | last post by:
I've created a class that offers an enhanced way of handling fatal exceptions. The class allows the user to optionaly submit a http based anonymous error report to myself, and also records details...
4
by: Steve Baer | last post by:
I've already tested this with C# and it works, but I'm being paranoid and I wanted to also check here. Our application has a large class library written in C++/CLI for plug-in projects. The...
3
by: AliR \(VC++ MVP\) | last post by:
Hi Everyone, I have written a silverlight application, which talks to a WCF service, which was created within the website after watching this video:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.