?
Solved

String conversion

Posted on 1999-01-28
1
Medium Priority
?
159 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 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