Solved

String conversion

Posted on 1999-01-28
1
155 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

815 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

9 Experts available now in Live!

Get 1:1 Help Now