Solved

Com BSTR * return nothing

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand to include initial dialog with two choices. 9 94
matchUp  challenge 6 82
building a service to accessed via telnet client, want colors ? 4 109
matchUp  challenge 9 134
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: 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 video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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