473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Call ATL from C# ASP.NET

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.

Nov 19 '05 #1
2 2427
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" <Za******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
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.

Nov 19 '05 #2
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" <Za******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
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.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Fabian Müller | last post by:
Hi all, my question is as follows: If have a class X and a class Y derived from X. Constructor of X is X(param1, param2) . Constructor of Y is Y(param1, ..., param4) .
35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
13
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
13
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will return me the required memory but the object is not...
3
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
12
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.