Exception a la fermeture d'une application avec c++ builder
bonjour a tous
c'est encore moi avec mes probl�mes en c++ builder :-)
voila, j'ai une exeption a la fermeture de mon application, je me rappel que quand je travaillais avec delphi je regl� �a en mettant un code qui commence avec 'try' dans le OnCreat de la fiche principale, mais je ne sais pas koi faire!
avez vous une id�e
1 pi�ce(s) jointe(s)
Exception avec c++ builder
bonjour
merci bcp, j'ai mis Close() dans le bloc try, mais je ne sais toujour pas koi mettre dans catch, c'est vous avez un exepmle il me sera d'une grande aide, je vous joint l'exception qu'il me fait.
merci
Exception a la fermeture d'application en c++ builder
bonsoir
merci a tous les deux, en fait j'ai utilis�e l'�xecution pas a pas et il se bloque a cette instruction:
Code:
inline void __stl_delete(void* __p) { ::operator delete(__p); }
j'ai compred pas grand chose, mais je suppose que c'est li� aux vector et a l'allocation memoire, c'est en fait la 1ere fois que je les utilise et en plus c'est ma 1ere application en c++, et le pire c'est que c'est un grand projet d�jas j'arrive pas, a ce stade, a tous controler.
ce que je voulais en fait, par ma question, c'est une astuce pour contourner cette excption: puisque elle n'influence pas vraiment mon projet, je l'ai juste a la sortie (Close()), donc plus pr�cisaiment je veux une fa�ons pour forcer a quitter, au lieu de faire a chaque fermeture Ctrl+f2...
Exception avec c++ builder
bonsoir
Citation:
Question : utilisez-vous seulement les librairies de Builder ou utilisez-vous aussi des containers comme std::vector ? Quel est le non du fichier qui contient cette instruction ?
oui, justement j'utilise std::vector.
le nom du fichier c'est new, voici tout le fichier:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
| /*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
#ifndef _STLP_NEW_HEADER
# define _STLP_NEW_HEADER
# ifndef _STLP_OUTERMOST_HEADER_ID
# define _STLP_OUTERMOST_HEADER_ID 0x447
# include <stl/_prolog.h>
# endif
// # include <stl/_new.h>
#ifdef _STLP_WINCE
inline void* _STLP_CALL __stl_new(size_t __n) {
return ::malloc(__n);
}
inline void _STLP_CALL __stl_delete(void* __p) {
free(__p);
}
#else
#ifndef _STLP_CSTDDEF
// size_t
# include <cstddef>
#endif
#if defined (__BORLANDC__) && (__BORLANDC__ > 0x520)
// new.h uses ::malloc ;(
# include <cstdlib>
using _STLP_VENDOR_CSTD::malloc;
#endif
# if !defined (_STLP_NO_NEW_NEW_HEADER)
# include _STLP_NATIVE_CPP_RUNTIME_HEADER(new)
# else
# include <new.h>
# endif
# ifndef _STLP_NO_BAD_ALLOC
# ifdef _STLP_USE_OWN_NAMESPACE
_STLP_BEGIN_NAMESPACE
using _STLP_VENDOR_EXCEPT_STD::bad_alloc;
using _STLP_VENDOR_EXCEPT_STD::nothrow_t;
using _STLP_VENDOR_EXCEPT_STD::nothrow;
# if defined (_STLP_GLOBAL_NEW_HANDLER)
using ::new_handler;
using ::set_new_handler;
# else
using _STLP_VENDOR_EXCEPT_STD::new_handler;
using _STLP_VENDOR_EXCEPT_STD::set_new_handler;
# endif
_STLP_END_NAMESPACE
# endif /* _STLP_OWN_NAMESPACE */
# else /* _STLP_NO_BAD_ALLOC */
# include <exception>
_STLP_BEGIN_NAMESPACE
class nothrow_t {};
# ifdef _STLP_OWN_IOSTREAMS
extern _STLP_DECLSPEC const nothrow_t nothrow;
# else
# define nothrow nothrow_t()
# endif
class bad_alloc : public _STLP_EXCEPTION_BASE {
public:
bad_alloc () _STLP_NOTHROW_INHERENTLY { }
bad_alloc(const bad_alloc&) _STLP_NOTHROW_INHERENTLY { }
bad_alloc& operator=(const bad_alloc&) _STLP_NOTHROW_INHERENTLY {return *this;}
~bad_alloc () _STLP_NOTHROW_INHERENTLY { }
const char* what() const _STLP_NOTHROW_INHERENTLY { return "bad alloc"; }
};
_STLP_END_NAMESPACE
#endif /* _STLP_NO_BAD_ALLOC */
# if defined (_STLP_NO_NEW_NEW_HEADER) || defined (_STLP_NO_BAD_ALLOC) && ! defined (_STLP_CHECK_NULL_ALLOC)
# define _STLP_CHECK_NULL_ALLOC(__x) void* __y = __x; if (__y == 0) _STLP_THROW(bad_alloc()); return __y
# else
# define _STLP_CHECK_NULL_ALLOC(__x) return __x
# endif
_STLP_BEGIN_NAMESPACE
#if (( defined(__IBMCPP__)|| defined(__OS400__) || defined (__xlC__) || defined (qTidyHeap)) && defined(__DEBUG_ALLOC__) )
inline void* _STLP_CALL __stl_new(size_t __n) { _STLP_CHECK_NULL_ALLOC(::operator _STLP_NEW(__n, __FILE__, __LINE__)); }
inline void _STLP_CALL __stl_delete(void* __p) { ::operator delete(__p, __FILE__, __LINE__); }
#else
# ifndef __BORLANDC__
inline void* _STLP_CALL __stl_new(size_t __n) { _STLP_CHECK_NULL_ALLOC(::operator _STLP_NEW(__n)); }
inline void _STLP_CALL __stl_delete(void* __p) { ::operator delete(__p); }
# else
inline void* __stl_new(size_t __n) { _STLP_CHECK_NULL_ALLOC(::operator _STLP_NEW(__n)); }
inline void __stl_delete(void* __p) { ::operator delete(__p); }
# endif
#endif
_STLP_END_NAMESPACE
#endif /* WINCE */
# if (_STLP_OUTERMOST_HEADER_ID == 0x447)
# include <stl/_epilog.h>
# undef _STLP_OUTERMOST_HEADER_ID
# endif
#endif /* _STLP_NEW */
// Local Variables:
// mode:C++
// End: |
il m'indique la ligne en rouge, qd il me fait l'exception.
d�sol�e, je vous envois tout �a parceque j'ai pas su r�soudre, j'espere que l'un de vous a une id�e.
Exception avec c++ builder
merci a tous, surtout a toi free07, tas raison, je d�truit un vector de dimension n+1, alors que je reserve un vector de dimension n.