Re: Parameter Name Warning?
From: Michael Kennedy [UB] (mkennedy_at_REMOVETHIS.unitedbinary.com)
Date: 04/13/04
- Next message: Adam Clauss: "Re: Parameter Name Warning?"
- Previous message: Michael Kennedy [UB]: "Re: Parameter Name Warning?"
- In reply to: Carl Daniel [VC++ MVP]: "Re: Parameter Name Warning?"
- Next in thread: Victor Bazarov: "Re: Parameter Name Warning?"
- Reply: Victor Bazarov: "Re: Parameter Name Warning?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 12:09:59 -0700
Hi Carl,
Please see my inline comments.
Regards,
Michael
"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam>
wrote in message news:%23TvpOlYIEHA.964@TK2MSFTNGP10.phx.gbl...
> Michael Kennedy [UB] wrote:
> > Victor,
> >
> > Please see the attached image. It's a screenshot from VS.NET 2003. I
> > had to blur out some of the code for intellectual property concerns,
> > but the error is *unmistakable*.
> >
> > Execute this line:
> >
> > CString value = f;
> >
> > Then in the watch window,
> >
> > value != f.
>
> The image you've posted doesn't show enough to conclude that. Clearly
> 'value.m_pszData' is pointing at a different location than 'f', but that's
> to be expected, since the assignment to CString will copy the value.
I think it does show enough code. The CString = does a string copy. The
resultant value of the CString is not equal to the value of the original
string. How could they be the same and have the CString's string value
different from the string value? I'm not talking about the pointer's value
(as indicated by both of us those differ because of the copy). I'm talking
about the text:
CString value = f;
value.GetBuffer() is "2c..."
f is "cc..."
How can that be disputed that the string value of value and the string value
of f are different?
What do you think value == f would return (that is the CString overloaded =
operator)? What do you think it would return if f = "2c" and
value.GetBuffer() = "2c"?
>
> Now, if the contents of those memory locations are different, that
> definitely would indicate something screwy! (Perhaps the contents are
> different, but you didn't show that).
>
> >
> > Note that this class is written as unmanaged C++ but is being used in
> > a managed C++ library. I could not reproduce the error in pure
> > unmanaged C++.
>
> I wonder if you're actually running under the managed debugger at this
> point, and if in managed code the names recorded in the meta-data do in
fact
> come from the declaration of the function and not from the definition as
> they ought to.
I am running under the managed debugger. I think that's the problem. From
how C++ works those variable names should come from the implmentation, not
the header as they are.
> -cd
>
>
- Next message: Adam Clauss: "Re: Parameter Name Warning?"
- Previous message: Michael Kennedy [UB]: "Re: Parameter Name Warning?"
- In reply to: Carl Daniel [VC++ MVP]: "Re: Parameter Name Warning?"
- Next in thread: Victor Bazarov: "Re: Parameter Name Warning?"
- Reply: Victor Bazarov: "Re: Parameter Name Warning?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|