Solved

Com BSTR * return nothing

Posted on 2004-09-24
2
428 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 75 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

617 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