Solved

Com BSTR * return nothing

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now