473,569 Members | 3,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(bui lt 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 1573
Perhaps if you supplied some details about the exception and the library
someone could provide some help.

"Venky" <Ve***@discussi ons.microsoft.c om> wrote in message
news:48******** *************** ***********@mic rosoft.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(bui lt 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***@discussi ons.microsoft.c om> wrote in message
news:48******** *************** ***********@mic rosoft.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(bui lt 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***@discussi ons.microsoft.c om> wrote in message
news:13******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:48******** *************** ***********@mic rosoft.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(bui lt 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******** ******@TK2MSFTN GP12.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***@discussi ons.microsoft.c om> wrote in message
news:13******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
> news:48******** *************** ***********@mic rosoft.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(bui lt 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***@discussi ons.microsoft.c om> wrote in message
news:75******** *************** ***********@mic rosoft.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******** ******@TK2MSFTN GP12.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***@discussi ons.microsoft.c om> wrote in message
news:13******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
> > news:48******** *************** ***********@mic rosoft.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(bui lt 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
2351
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
1742
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 the following linker warnings. The object files referenced are part of the VC6 built libraries: MiLibd.lib(MiInternetAddress.obj) : error LNK2019:...
5
279
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 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++...
10
2665
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 .NET2003. also, when I do not try to link the fortran library (just to see if that was the cause), it builds the exe without any problems. i don't...
6
1949
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 find one of the DLLs or its dependencies. Yet the DLL is present in the application folder, and it only has system tool dependencies, which are also...
0
6587
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 every the of C++ project I try to build. Not just Class Libraries, but a plain Windows Form Application as well. I've tried creating new...
5
3822
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 in the application log. The static method is overloaded, and supports passing exceptions and/or strings just like throwing an exception.The class...
4
1383
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 original library was written in C++ and the general rule for not breaking our SDK is to not change the class size by adding member variables and to not...
3
3527
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: http://silverlight.net/learn/learnvideo.aspx?video=47177 The service gathers some data using a class library. This all works fine within Visual Studio, but when published to a web server...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
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 we have to send another system
1
1229
muto222
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.