?
Solved

String conversion

Posted on 1999-01-28
1
Medium Priority
?
162 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 200 total points
ID: 1328429
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
In this post we will learn different types of Android Layout and some basics of an Android App.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 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