Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Call ATL from C# ASP.NET

Reply
Thread Tools

Call ATL from C# ASP.NET

 
 
=?Utf-8?B?WmFrIE1pbGFz?=
Guest
Posts: n/a
 
      04-05-2005
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.

 
Reply With Quote
 
 
 
 
Rick Strahl [MVP]
Guest
Posts: n/a
 
      04-06-2005
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



"Zak Milas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?WmFrIE1pbGFz?=
Guest
Posts: n/a
 
      04-06-2005
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

"Rick Strahl [MVP]" wrote:

> 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
>
>
>
> "Zak Milas" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aspx page, C#, trying to instantiate a C++ ATL COM control WTH ASP .Net 1 11-01-2004 10:36 PM
HELP !!! Managed C++, WinForms and ATL !!! Dmitry ASP .Net 0 11-01-2004 07:27 PM
could not start ASP.NET or ATL Server Debugging Tarundeep Singh Kalra ASP .Net 2 04-13-2004 05:12 AM
Q: Which one is better for parsing 30MB files ? ATL/COM or VB/COM Ramie MCSD 11 10-30-2003 09:22 PM
My ATL com activex control not working in C# & VB .net Sunil George ASP .Net 1 08-06-2003 08:34 AM



Advertisments