Solved

Com BSTR * return nothing

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Best tools for Backup and restore of Wordpress site 6 57
EvenOdd challenge 10 128
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 104
unix example issues 18 100
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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