[xsd-users] Access Violation
bruno.marotta at fortis.com
bruno.marotta at fortis.com
Thu Jun 26 10:51:18 EDT 2008
Find out the solution (but it does make too much sense). If a create the object explicitely it works:
obj.action(xml::action((xml::action::value)at));
in the place of
obj.action((xml::action::value)at);
Regards
-----Original Message-----
From: xsd-users-bounces at codesynthesis.com [mailto:xsd-users-bounces at codesynthesis.com] On Behalf Of Marotta Bruno
Sent: Thursday, June 26, 2008 3:56 PM
To: xsd-users at codesynthesis.com
Subject: [xsd-users] Access Violation
Hi,
I have a very simple class automatically generated by cxx tree, that when instantiated like this:
obj.action((xml::action::value)at);
raises an Access Violation...
at is an integer and its current value is 17. From the call stack it seems that the error occurs when freeing a temporarily created action instance...
Here follows the class definition:
class __declspec(dllexport) action: public ::xml_schema::string
{
public:
enum value
{
New,
LimitCheck,
Exercise,
Expiry,
BarrierHit,
Cancel,
CancelAndReissue,
Restructure,
EarlyTermination,
Fixing,
Unwind,
CancelOfMO,
Novation,
Netting,
AddTrial,
Update,
Delete,
OtherContractEvent
};
action ();
action (value v);
action (const ::xml_schema::string& v);
action (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::type* c = 0);
action (const ::xercesc::DOMAttr& a,
::xml_schema::flags f = 0,
::xml_schema::type* c = 0);
action (const ::std::string& s,
const ::xercesc::DOMElement* e,
::xml_schema::flags f = 0,
::xml_schema::type* c = 0);
action (const action& x,
::xml_schema::flags f = 0,
::xml_schema::type* c = 0);
virtual action*
_clone (::xml_schema::flags f = 0,
::xml_schema::type* c = 0) const;
action&
operator= (value v);
virtual
operator value () const
{
return _xsd_action_convert ();
}
protected:
value
_xsd_action_convert () const;
public:
static const char* const _xsd_action_literals_[18];
static const value _xsd_action_indexes_[18];
};
The class code:
// action
//
action::
action ()
: ::xml_schema::string ()
{
}
action::
action (value v)
: ::xml_schema::string (_xsd_action_literals_[v])
{
}
action::
action (const ::xml_schema::string& v)
: ::xml_schema::string (v)
{
}
action::
action (const action& v,
::xml_schema::flags f,
::xml_schema::type* c)
: ::xml_schema::string (v, f, c)
{
}
action& action::
operator= (value v)
{
static_cast< ::xml_schema::string& > (*this) =
::xml_schema::string (_xsd_action_literals_[v]);
return *this;
}
The call stack:
ntdll.dll!_DbgBreakPoint at 0()
vrfcore.dll!00363933()
vfbasics.dll!003a09b7()
vfbasics.dll!0039b953()
msvcr71d.dll!_heap_alloc_base(unsigned int size=3846624) Line 212 C
vfbasics.dll!003a236f()
vfbasics.dll!003a236f()
vfbasics.dll!0039928a()
vfbasics.dll!0039928a()
vfbasics.dll!0039707a()
vfbasics.dll!003967ed()
vrfcore.dll!00367487()
ntdll.dll!_RtlpDphReportCorruptedBlock at 16() + 0x151
ntdll.dll!_RtlpDphNormalHeapFree at 12() + 0x2e
ntdll.dll!_RtlpDebugPageHeapFree at 12() + 0x79
ntdll.dll!_RtlDebugFreeHeap at 12() + 0x2c
ntdll.dll!_RtlFreeHeapSlowly at 12() + 0x23d19
ntdll.dll!_RtlFreeHeap at 12() + 0x16470
vfbasics.dll!0039bb0b()
msvcr71.dll!free(void * pBlock=0x0a8120a0) Line 103 C
msvcp71.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(bool _Built=true, unsigned int _Newsize=0) Line 1517 + 0x6 C++
msvcp71.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 458 C++
TradeExporterBase.dll!xsd::cxx::tree::string<char,xsd::cxx::tree::simple_type<xsd::cxx::tree::_type> >::~string<char,xsd::cxx::tree::simple_type<xsd::cxx::tree::_type> >() + 0x6b C++
TradeExporterBase.dll!xml::action::~action() + 0x2b C++
I hope you can help me.
Regards,
Bruno Marotta
= = = = = = = = = = = = = = = = = = = = = = = = =
Fortis disclaimer :
http://www.fortis.be/legal/disclaimer.htm
Privacy policy related to banking activities of Fortis:
http://www.fortis.be/legal/privacy_policy.htm
= = = = = = = = = = = = = = = = = = = = = = = = =
More information about the xsd-users
mailing list