Seems to be related to the debugger..
- From: "Fredrik Wahlgren" <fredrik.p.wahlgren@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 12 Feb 2006 00:02:23 +0100
I now found that if I use "Start Without Debugging", everything works OK. I
only get garbage when I use "Start Debugging". I use VS2005 version
8.0.50727.42 I guess it's a MS bug. Weird!
/Fredrik
"Igor Tandetnik" <itandetnik@xxxxxxxx> skrev i meddelandet
news:efs0gZ1LGHA.1288@xxxxxxxxxxxxxxxxxxxxxxx
"Fredrik Wahlgren" <fredrik.p.wahlgren@xxxxxxxxxxxxxxxxxx> wrote in
message news:uC3NIQ1LGHA.2916@xxxxxxxxxxxxxxxxxxxx
In order
to try out the idea, I created a very simple internal function that
adds two floating point numbers, passed as strings. The return value
would also be a string. I called it like this
sSum = pFunc->xFunc(L"SUM", L"0,1", L"0,2"", L"0,3");
The result should be the string "0,6". All I get is garbage unless I
call it like this:
pFunc->raw_xFunc(L"SUM", L"0,1", L"0,2"", L"0,3", &sSum);
What's sSum? It should be _bstr_t or CComBSTR. If you use raw BSTR here,
you will end up with a dangling pointer - that's probably why you see
garbage. Note that ATL (or in general, the server side implementation) has
nothing to do with it - it is the artifact of #import-generated wrappers.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: Seems to be related to the debugger..
- From: Igor Tandetnik
- Re: Seems to be related to the debugger..
- References:
- Weird string problem. "Marilyn" is OK but not "0,6"
- From: Fredrik Wahlgren
- Re: Weird string problem. "Marilyn" is OK but not "0,6"
- From: Igor Tandetnik
- Weird string problem. "Marilyn" is OK but not "0,6"
- Prev by Date: Re: Weird string problem. "Marilyn" is OK but not "0,6"
- Next by Date: Re: Weird string problem. "Marilyn" is OK but not "0,6"
- Previous by thread: Re: Weird string problem. "Marilyn" is OK but not "0,6"
- Next by thread: Re: Seems to be related to the debugger..
- Index(es):
Relevant Pages
|