How to pass string to atl com dll from visual c#

G

Guest

Hi,

What data type(wchar or bstr or variant) I have to give for string in
atl com dll which will use in asp.net aplication and code-behind is visual c#?

code snippet:
STDMETHODIMP CMyTest::TestStringFunc(BSTR bstrFilesInfo)
{
// TODO: Add your implementation code here
return S_OK;
}


In Visual C#, what data type I have to take to send the string data to
atl com dll?

protected void Button1_Click(object sender, EventArgs e)
{
MyTestClass obj = new MyTestClass();
obj.TestStringFunc("hi welcome to visual c#"); //application getting
crash here.
Response.Write("Durga...4");
}
//error info:Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top