[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

String conversion

Posted on 1999-01-28
1
Medium Priority
?
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

649 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