473,466 Members | 1,503 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Strange behaviour in VC 7.1

Hi,

I have written a simple test harness (exe) for a C++ (native) DLL that
exports some C++ objects. The objects throw exceptions when they an
error occurs in the Ctor, and the test harness is supposed to catch the
exception.

I have noticed that when I am debugging the DLL (i.e. using the test
harness executable as the app to call the DLL), the exceptions are
caught (as expected), in the test harness code. However, when I am
debugging the test harness application (i.e. simply stepping through the
code of the test harness), the exceptions are not being caught. Has
anyone come across this before - is this a "feature" or a bug?

Nov 17 '05 #1
2 1042
"Alfonso Morra" <sw***********@the-ring.com> wrote in message
news:dd**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
I have written a simple test harness (exe) for a C++ (native) DLL that
exports some C++ objects. The objects throw exceptions when they an error
occurs in the Ctor, and the test harness is supposed to catch the
exception.

I have noticed that when I am debugging the DLL (i.e. using the test
harness executable as the app to call the DLL), the exceptions are caught
(as expected), in the test harness code. However, when I am debugging the
test harness application (i.e. simply stepping through the code of the
test harness), the exceptions are not being caught. Has anyone come across
this before - is this a "feature" or a bug?


As always the devil is in the details. What kind of exceptions are we
talking about and how are you catching them?

If you are mixing Win32 structured exceptions (via __try/__except) and C++
typed exceptions (via try/catch) it is entirely possible that you will see
different behavior in release and debug builds.

But there is not much point in waxing technical on this point unless that's
what you are doing.

Regards,
Will
Nov 17 '05 #2


William DePalo [MVP VC++] wrote:
"Alfonso Morra" <sw***********@the-ring.com> wrote in message
news:dd**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
I have written a simple test harness (exe) for a C++ (native) DLL that
exports some C++ objects. The objects throw exceptions when they an error
occurs in the Ctor, and the test harness is supposed to catch the
exception.

I have noticed that when I am debugging the DLL (i.e. using the test
harness executable as the app to call the DLL), the exceptions are caught
(as expected), in the test harness code. However, when I am debugging the
test harness application (i.e. simply stepping through the code of the
test harness), the exceptions are not being caught. Has anyone come across
this before - is this a "feature" or a bug?

As always the devil is in the details. What kind of exceptions are we
talking about and how are you catching them?

If you are mixing Win32 structured exceptions (via __try/__except) and C++
typed exceptions (via try/catch) it is entirely possible that you will see
different behavior in release and debug builds.

But there is not much point in waxing technical on this point unless that's
what you are doing.

Regards,
Will


I managed to get this sorted. It was a bit of a red herring. The problem
was that the different projects were using libraries in different
folders - so my latest code changes were not being reflected in one of
the DLLS (the one that was being loaded fro the test harness). once I
deleted the offending DLL and change dthe paths - everything is OK.
Thanks anyway.

Nov 17 '05 #3

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

Similar topics

0
by: Frank Passek | last post by:
Dear all, I've encountered some strange behaviour with PHP (4.3.2) using the CLI-API. When I provide an option in the first line of my script like so: #!/usr/bin/php -c /path_to_my_ini_file and...
0
by: Phil | last post by:
Hi, I don't understand this strange behaviour: I compile this code : #include <Python.h> #include"Numeric/arrayobject.h" static PyObject *
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
3
by: Bruno van Dooren | last post by:
Hi All, i have some (3) different weird pointer problems that have me stumped. i suspect that the compiler behavior is correct because gcc shows the same results. ...
3
by: Sebastian C. | last post by:
Hello everybody Since I upgraded my Office XP Professional to SP3 I got strange behaviour. Pieces of code which works for 3 years now are suddenly stop to work properly. I have Office XP...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
31
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
4
by: Gotch | last post by:
Hi, I'm getting a very strange behaviour while running a project I've done.... Let's expose it: I've two projects. Both of them use a Form to do some Gui stuff. Other threads pack up messages...
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
20
by: Pilcrow | last post by:
This behavior seems very strange to me, but I imagine that someone will be able to 'explain' it in terms of the famous C standard. -------------------- code -----------------------------------...
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
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
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
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...
0
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 ...

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.