Solved

String conversion

Posted on 1999-01-28
1
152 Views
Last Modified: 2013-11-20
I tried to write a ATL DLL, which is accessed from Basic. However, this code is not working (I try to return some CStrings to Basic):

STDMETHODIMP CCRSData::GetInfos(BSTR *pDateSaved...)
{
     CComBSTR DateSaved(m_CRSInfos.DateSaved);
    *pDateSaved = BSTR(DateSaved);
return S_OK;
}
0
Comment
Question by:a3804
1 Comment
 
LVL 13

Accepted Solution

by:
Mirkwood earned 50 total points
Comment Utility
CComBSTR deletes the BSTR again.
Try this

STDMETHODIMP CCRSData::GetInfos(BSTR *pDateSaved...)
{
     CComBSTR DateSaved(m_CRSInfos.DateSaved);
    *pDateSaved = SysAllocString(DateSaved);
return S_OK;
}
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now