Call ATL from C# ASP.NET

G

Guest

Hello
I have created an ATL in VC++ and want to call the function from a click of
a button on C# ASP.NET. I was able to reference my DLL file in ASPX, but
unfortunately it has two CHAR inputs and one VARIANT* output.

How do I call this function that returns a value in C# ASP.NET. Thank you
very much in advance. Here is what I did so far.

// Call the ATL function
Connections.CConnSetClass Dconn = new Connections.CConnSetClass();

Dconn.VerifyPassword(Convert.ToSByte(txtSerialNum.Text),Convert.ToSByte(txtPassword.Text), strResult);

it does not like the return value strResult.
 
R

Rick Strahl [MVP]

HI Zak,

Is there a type library with the ATL component? It might be best to do a
TLBIMP on the component to get the proper type conversions into a .NET
object, then use that object instead.

It looks like you're using VB.NET with Option strict off to do this right
now which means you are guessing at the type conversions. If you don't have
a TLB (or it's not compiled into the DLL) take a look at the MSDN COM
interop section and see what CHAR maps to exactly.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 
G

Guest

Hi!
Actually I was to compile the DLL and reference it in my ASP page as an
object. But now that I using the object I wanted it to return a value and was
wondering how its done in C# ASP. Thanks
 

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