Changing the default packing for the compiler is a tricky thing -- You have
no idea what will be affected, because _any_ structure defined in any
included could cause problems.  If you really have rebuilt things using
/Zp1, then there are most likely other libraries which Xerces depends on
that are also affected.

Again, this has _nothing_ to do with Xerces-C++.  You're messing with
something fundamental, and there's a considerable amount of work to be done
to make sure everything works correctly.  Here's what the help text for
this option says:

   This setting allows you to use non-standard alignments for data
   structure members. Alignments other than the default can cause severe
   application performance degradation due to alignment faults and
   subsequent fixups. Change this setting from the default with caution.
   This setting changes the value of the /Zp compiler switch.

I think you're much better off keeping the default structure alignment and
making a special case for those structures which you need to pass between
your layers.

OK, that's the last I'm going to say on this topic...

Dave



                                                                                       
                                               
                      "Gopi Krishna"                                                   
                                               
                      <gopik@mindtree.         To:      <[EMAIL PROTECTED]>  
                                               
                      com>                     cc:                                     
                                               
                                               Subject: RE: VC++ /Zp1....failure       
                                               
                      01/23/2002 02:21                                                 
                                               
                      PM                                                               
                                               
                      Please respond                                                   
                                               
                      to xerces-c-dev                                                  
                                               
                                                                                       
                                               
                                                                                       
                                               




hi,

Ya read the faq. I think I am setting correctly.
Because my program works with /zp8 settings and not with /zp1 settings.

ok, I wrote a dll which basically gets the data from the server in XML
and parses it. I also wrote a small test program to check this.
>From my test program, I call only 2 interfaces of the dll which basically
initializes the xml parser, creates the parser object and the other
interface
deletes the parser object and Uninitializes. When I build the dll using
/zp8 everything works fine. If I change the settings to /zp1, delete parser
fails. I am not exchanging any datastructure between my test program and
the
Dll.
I dont understand what the problem is...

thanks,
Gopi

-----Original Message-----
From: David N Bertoni/CAM/Lotus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 3:39 AM
To: [EMAIL PROTECTED]
Subject: RE: VC++ /Zp1....failure



Are you using the correct run-time?  Read the FAQ:

   http://xml.apache.org/xerces-c/faq-parse.html#faq-26

Dave





                      "Gopi Krishna"

                      <gopik@mindtree.         To:
<[EMAIL PROTECTED]>

                      com>                     cc:

                                               Subject: RE: VC++
/Zp1....failure
                      01/23/2002 01:56

                      PM

                      Please respond

                      to xerces-c-dev









HI,

I took the Xerces source files and built the library with
/Zp1 option set.
Still I get the same error at the same point.
what could be wrong???

thanks and regards,
Gopi

-----Original Message-----
From: David N Bertoni/CAM/Lotus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 3:02 AM
To: [EMAIL PROTECTED]
Subject: RE: VC++ /Zp1....failure




You should be asking such questions in a Visual-C++ forum, not a Xerces
forum.

There is a compiler pragma that allows changing structure packing at the
source code level.  You can place these pragmas before and after the header
files for which you want to change the packing.  See the online help for
information on pragma and the pack option.  You especially will want to
push and pop:

#pragma pack push 1
#include <otherlayer/foo.h>
#pragma pop

You can then set the alignment for your layer to the default.  You can do
it the other way around, but any change to the default packing size would
require you update the packing alignment for Xerces.

Dave





                      "Gopi Krishna"

                      <gopik@mindtree.         To:
<[EMAIL PROTECTED]>

                      com>                     cc:

                                               Subject: RE: VC++
/Zp1....failure
                      01/23/2002 12:49

                      PM

                      Please respond

                      to xerces-c-dev










HI,

Thanks  for the reply....
The  problem is,
Our  application has been divided into 3 layers. Presentation,control and
the data  communication layers.
I am  writing the Data comm layer.� I will get the C data structures from
the  other layers in the zp1 format and
I need  to populate the structures after parsing the XML file received from
the server.
So, I  cant change the alignment to /Zp8 (default).

How do  I get around with this problem??

Please  Help

Thanks
Gopi

-----Original Message-----
From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002  2:13 AM
To: [EMAIL PROTECTED]
Subject: Re: VC++  /Zp1....failure



You must use the same structure alignment in your application the
pre-compiled Xerces library uses. You could try rebuilding Xerces with the
structure alignment you want to use, but I wouldn't recommend it.

The  bottom line is you shouldn't be mucking with such an option unless you
understand the ramifications.

Dave

[IMAGE]"Gopi Krishna"  <[EMAIL PROTECTED]>



  [IMA   [IMAGE]              [IMAGE]
  GE]
         "Gopi                To:  <[EMAIL PROTECTED]>
         Krishna"             cc:
         <gopik@mindt         Subject: VC++  /Zp1....failure
         ree.com>

         01/23/2002
         11:33 AM
         Please
         respond to
         xerces-c-dev







HI,

I have a small cpp file where I will create a parser  object as

DOMParser���  parser� = new DOMParser();
....
,,....


and call

delete parser after that in the same block.

I created this in a VC++ Debug Mode. If I set the  structure alignment
option as /Zp8 ( default ),
everything works fine but  when I change to /Zp1, it cribs at the line
where i do
delete parser. The  error is

�DAMAGE: after Normal  block(#48) at 0x010c.......



could anyone tell me why  this is happening?

Your help will be Highly  appreciated...

Regards and  Thanks
gopi





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to