Click here to Skip to main content
16,007,443 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Terminating app smoothly? Pin
James R. Twine19-Jun-02 8:09
James R. Twine19-Jun-02 8:09 
QuestionAny samples for inserting an image into a BLOB field of a DB2 table using VC++ 6.0? Pin
Shayna19-Jun-02 5:27
Shayna19-Jun-02 5:27 
GeneralRetreiving BSTR Pin
Hans Ruck19-Jun-02 5:09
Hans Ruck19-Jun-02 5:09 
GeneralRe: Retreiving BSTR Pin
19-Jun-02 5:19
suss19-Jun-02 5:19 
GeneralNope (Was: Re: Retreiving BSTR) Pin
James R. Twine19-Jun-02 8:25
James R. Twine19-Jun-02 8:25 
GeneralRe: Nope (Was: Re: Retreiving BSTR) Pin
Philippe Mori19-Jun-02 9:29
Philippe Mori19-Jun-02 9:29 
GeneralRe: Nope (Was: Re: Retreiving BSTR) Pin
James R. Twine19-Jun-02 9:47
James R. Twine19-Jun-02 9:47 
GeneralRe: Retreiving BSTR Pin
James R. Twine19-Jun-02 8:14
James R. Twine19-Jun-02 8:14 
   Hmmm... I am under the impression that when the temporary bstr_t object is destroyed, it deallocates the BSTR it wrapped...?  That would cause the BSTR you return to be invalid.  Try looking at the contents (not value) of *pRetval in the debugger right when you get to the delete [] sz line.

   You should just be using SysAllocString(...) directly, similar to:

<br />
#include <AFXPriv.h> // -or- <ATLConv.h><br />
<br />
USES_CONVERSION;<br />
<br />
*pRetval = ::SysAllocString( A2CW( sz ) );<br />


   Peace!

-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
[Get Check Favorites 1.4 Now!]
GeneralRe: Retreiving BSTR Pin
Hans Ruck19-Jun-02 8:31
Hans Ruck19-Jun-02 8:31 
GeneralRe: Retreiving BSTR Pin
James R. Twine19-Jun-02 9:27
James R. Twine19-Jun-02 9:27 
QuestionDoes Anybody Know???? Pin
19-Jun-02 4:35
suss19-Jun-02 4:35 
AnswerRe: Does Anybody Know???? Pin
Chris Losinger19-Jun-02 5:57
professionalChris Losinger19-Jun-02 5:57 
GeneralRe: Does Anybody Know???? Pin
19-Jun-02 6:56
suss19-Jun-02 6:56 
GeneralRe: Does Anybody Know???? Pin
Chris Losinger19-Jun-02 7:21
professionalChris Losinger19-Jun-02 7:21 
GeneralRe: Does Anybody Know???? Pin
19-Jun-02 9:04
suss19-Jun-02 9:04 
GeneralRe: Does Anybody Know???? Pin
Alan Chambers19-Jun-02 10:01
Alan Chambers19-Jun-02 10:01 
GeneralCoding Dilemma Pin
Nic Oughton19-Jun-02 4:34
professionalNic Oughton19-Jun-02 4:34 
GeneralRe: Coding Dilemma Pin
Joaquín M López Muñoz19-Jun-02 5:26
Joaquín M López Muñoz19-Jun-02 5:26 
GeneralRe: Coding Dilemma Pin
perlmunger19-Jun-02 9:26
perlmunger19-Jun-02 9:26 
GeneralRe: Coding Dilemma Pin
Michael P Butler19-Jun-02 9:26
Michael P Butler19-Jun-02 9:26 
GeneralRe: Coding Dilemma Pin
Nic Oughton20-Jun-02 0:37
professionalNic Oughton20-Jun-02 0:37 
Generallisting printer trays Pin
pnpfriend19-Jun-02 4:25
pnpfriend19-Jun-02 4:25 
Generalget to the top of a file Pin
Steve L.19-Jun-02 3:24
Steve L.19-Jun-02 3:24 
GeneralRe: get to the top of a file Pin
Niklas L19-Jun-02 3:36
Niklas L19-Jun-02 3:36 
GeneralRe: get to the top of a file Pin
Steve L.19-Jun-02 3:56
Steve L.19-Jun-02 3:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.