Call ATL from C# ASP.NET

Discussion in 'ASP .Net' started by =?Utf-8?B?WmFrIE1pbGFz?=, Apr 5, 2005.

  1. 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.
     
    =?Utf-8?B?WmFrIE1pbGFz?=, Apr 5, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
    >
     
    Rick Strahl [MVP], Apr 6, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > > 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.
    > >

    >
    >
    >
     
    =?Utf-8?B?WmFrIE1pbGFz?=, Apr 6, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tarundeep Singh Kalra

    could not start ASP.NET or ATL Server Debugging

    Tarundeep Singh Kalra, Apr 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    7,526
    Tarundeep Singh Kalra
    Apr 13, 2004
  2. WTH
    Replies:
    1
    Views:
    367
    Rick Strahl [MVP]
    Nov 2, 2004
  3. =?Utf-8?B?VG9ueVI=?=
    Replies:
    2
    Views:
    7,877
    =?Utf-8?B?VG9ueVI=?=
    May 19, 2005
  4. =?Utf-8?B?Um91bWVs?=
    Replies:
    0
    Views:
    403
    =?Utf-8?B?Um91bWVs?=
    Mar 13, 2007
  5. =?Utf-8?B?Sm9obg==?=
    Replies:
    1
    Views:
    718
    Petar Atanasov
    Apr 4, 2007
Loading...

Share This Page