You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Rhys Black <pd...@yahoo.com> on 2002/04/01 22:19:42 UTC

Re: FYI - small bug?

--- "Jason E. Stewart" <ja...@openinformatics.com>
wrote:
> "Rhys Black" <pd...@yahoo.com> writes:
> 
> >     char *p = s.transcode();
> >     target << p;
> >     return target;
> >     delete [] p;
> > }
> > 
> > I copied this code from the DOMPrint example.  The
> > error seems to be in deleting variable p.  I think
> the
> > problem is that variable p does not need to be
> > deleted, seeing as how it was not new-ed onto the
> > stack.  
> 
> Not true, transcode() allocates memory and it is up
> to the caller to
> free it.
> 
> jas.
ah -  thanks!

I'll look into the code for transcode(), but my
compiler BCB5 throws an error message at run time that
interrupts execution at the line deleting pointer p. 
When that line is deleted, there is no problem.

Any thoughts?
~Rhys Black


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: FYI - small bug?

Posted by Rhys Black <pd...@yahoo.com>.
--- Joachim Achtzehnter <jo...@netacquire.com>
wrote:
> Rhys Black wrote:
> >
> > my compiler BCB5 throws an error message at run
> time that
> > interrupts execution at the line deleting pointer
> p.
> > When that line is deleted, there is no problem.
> 
> This is a FAQ:
> 
>  
> http://xml.apache.org/xerces-c/faq-parse.html#faq-26
> 
> Your code and Xerces must link with the same C
> runtime DLL.
> 
> Joachim
All right.  After having reviewed, again (I did read
it, before), I can see how the below section may refer
to my problem.  I can not, however, understand what it
says is the problem.  Someone mind helping by
translating?  I use BCB5, and built the files without
a hitch.  I assume that it means that I had invalid
settings when I built the xerceslib.dll (from don's
suggestion to check the dependency with
dependencywalker).  There is another reply from me
about the results of that enquiry, and it was not what
Don said it should be...

This is the best information I have (especially during
midterms and carrying 3 programming classes plus a
programming logic class in 8 weeks :) - suicidal, I
know, but c'est la vie).  If anyone points me for the
next thing to check, I'll do it.  Thanks in advance
for the help!

~Rhys Black

Why does deleting a transcoded string result in
assertion on windows?  
   
 
  Both your application program and the Xerces DLL
must use the same *DLL* version of the runtime
library. If either statically links to the runtime
library, the problem will still occur. For example,
for a Win32/VC6 build, the runtime library build
setting MUST be "Multithreaded DLL" for release builds
and "Debug Multithreaded DLL" for debug builds.
 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: FYI - small bug?

Posted by Joachim Achtzehnter <jo...@netacquire.com>.
Rhys Black wrote:
>
> my compiler BCB5 throws an error message at run time that
> interrupts execution at the line deleting pointer p.
> When that line is deleted, there is no problem.

This is a FAQ:

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

Your code and Xerces must link with the same C runtime DLL.

Joachim

-- 
work:     joachima@netacquire.com   (http://www.netacquire.com)
private:  joachim@kraut.ca          (http://www.kraut.ca)


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: FYI - small bug?

Posted by Don Mastrovito <dm...@marathontechnologies.com>.
Rhys,

Perhaps you read too much into my last message.  Run dependency walker on 
XercesLib.dll AND on your application, not the compiler.  The compiler 
merely translates your code into binary cruft that the linker conjures into 
an executable image.  So in a properly functioning BCB5 environment, 
XercesLib.dll and your app (umkay?) should both claim to use 
cc3250mt.dll.  Kernel32, User32, Advapi32, and Oleaut are all M$ supplied 
dlls that provide support for various API.  For the most part, public API 
usually expect the caller (your application) to provide pre-allocated 
memory buffers.  Internally, they probably call Kernel32 routines like 
LocalAlloc or LocalFree to perform the necessary allocation and freeing of 
memory.

Just a thought.  Did you rebuild XercesLib.dll or are you using the 
pre-built stuff?

Don

At 06:58 PM 4/7/2002 -0700, you wrote:

>--- Don Mastrovito
><dm...@marathontechnologies.com> wrote:
> > Rhys,
> >
> > Using Dependency Walker
> > (http://www.dependencywalker.com/) check your copy
> > of XercesLib.dll and your application exe file.
> > Both should be using
> > cc32x0mt.dll where x=6 for BCB6, x=5 for BCB5, etc.
> >
> > Don
>umkay -  using bcb5
>xerceslib.dll uses cc3250mt.dll
>cc3250mt.dll uses advapi32.dll
>                   kernel32.dll
>                   user32.dll
>                   oleaut.dll
>bcb.exe does not use cc3250mt.dll
>bcb.exe does not use cc3250mt.dll
>bcb.exe does use advapi32.dll
>                  kernel32.dll
>                  user32.dll
>                  oleaut.dll directly
>where to from here, don?
>
>btw - thanks! for the tool :)
>I'm sure I already had it bundled in something I had,
>but didn't know it, previously.  Being a fledgling
>programmer, I am certain I will get a lot of mileage
>out of it.
>~Rhys
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Tax Center - online filing with TurboTax
>http://taxes.yahoo.com/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: FYI - small bug?

Posted by Rhys Black <pd...@yahoo.com>.
--- Don Mastrovito
<dm...@marathontechnologies.com> wrote:
> Rhys,
> 
> Using Dependency Walker
> (http://www.dependencywalker.com/) check your copy 
> of XercesLib.dll and your application exe file. 
> Both should be using 
> cc32x0mt.dll where x=6 for BCB6, x=5 for BCB5, etc.
> 
> Don
umkay -  using bcb5
xerceslib.dll uses cc3250mt.dll
cc3250mt.dll uses advapi32.dll
                  kernel32.dll
                  user32.dll
                  oleaut.dll
bcb.exe does not use cc3250mt.dll
bcb.exe does not use cc3250mt.dll
bcb.exe does use advapi32.dll
                 kernel32.dll
                 user32.dll
                 oleaut.dll directly
where to from here, don?

btw - thanks! for the tool :)
I'm sure I already had it bundled in something I had,
but didn't know it, previously.  Being a fledgling
programmer, I am certain I will get a lot of mileage
out of it.
~Rhys

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: FYI - small bug?

Posted by Don Mastrovito <dm...@marathontechnologies.com>.
Rhys,

Using Dependency Walker (http://www.dependencywalker.com/) check your copy 
of XercesLib.dll and your application exe file.  Both should be using 
cc32x0mt.dll where x=6 for BCB6, x=5 for BCB5, etc.

Don

At 12:19 PM 4/1/2002 -0800, you wrote:

>--- "Jason E. Stewart" <ja...@openinformatics.com>
>wrote:
> > "Rhys Black" <pd...@yahoo.com> writes:
> >
> > >     char *p = s.transcode();
> > >     target << p;
> > >     return target;
> > >     delete [] p;
> > > }
> > >
> > > I copied this code from the DOMPrint example.  The
> > > error seems to be in deleting variable p.  I think
> > the
> > > problem is that variable p does not need to be
> > > deleted, seeing as how it was not new-ed onto the
> > > stack.
> >
> > Not true, transcode() allocates memory and it is up
> > to the caller to
> > free it.
> >
> > jas.
>ah -  thanks!
>
>I'll look into the code for transcode(), but my
>compiler BCB5 throws an error message at run time that
>interrupts execution at the line deleting pointer p.
>When that line is deleted, there is no problem.
>
>Any thoughts?
>~Rhys Black
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Greetings - send holiday greetings for Easter, Passover
>http://greetings.yahoo.com/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org