?
Solved

Com BSTR * return nothing

Posted on 2004-09-24
2
Medium Priority
?
435 Views
Last Modified: 2013-11-20
Why the sub below return nothing and not "123" when i call method from asp using:
Lst = Com.AskLogDialLst("61795,3278")

STDMETHODIMP CCom::AskLogDialLst(BSTR Lst, BSTR *Result)
{
      AFX_MANAGE_STATE(AfxGetStaticModuleState());
      Result = (BSTR *)("123");
      WSACleanup();

      return S_OK;
}
0
Comment
Question by:mammouth
[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
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 300 total points
ID: 12146918
That's not really surprising. That should be

STDMETHODIMP CCom::AskLogDialLst(BSTR Lst, BSTR *Result)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    *Result = SysAllocString(L"123");
   
    return S_OK;
}

0
 
LVL 1

Author Comment

by:mammouth
ID: 12147005
Ok, normally, "123" is content of      char *Resultchr.

If i put *Resultchr as place of "123", it give me error C3861: 'L': identifier not found, even with argument-dependent lookup
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

719 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