473,387 Members | 1,535 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,387 software developers and data experts.

"ASPCompat" attribute

Hi.
I have an ActiveX DLL, developed in Visual Basic 6.0 and I need to use that
DLL inside an ASP.NET application, developed in Visual Basic .Net 2003.

My problem is that in my machine I get the error "QueryInterface for
interface ... failed" when I try to use same method of the ActiveX DLL. I try
the same application in another machine and everything works fine. I found
that if I set the "AspCompat=True" attribute in the page the application
works fine in all machines.

My questions are:

1. Why the same ASP.NET application in my machine doesn’t work without the
"ASPCompat" attribute and works in another machine?

2. There is same way to avoid using the "ASPCompat" attribute and have the
ASP.NET application working in any machine?

3. Can anyone point me an article where Microsoft describes step-by-step how
to use a Visual Basic 6.0 DLL called from an ASP.NET application? I found the
article http://support.microsoft.com/kb/811658/en-us but the focus of this
one is the debug and not the development of the solution.

Thanks in advance,
Sérgio Martins
Nov 9 '07 #1
2 2113
you must use the aspcompat feature with sta com objects (all vb6 objects
are sta). this is because asp.net is free threaded and does not honor
sta requirements.

http://msdn2.microsoft.com/en-us/library/zwk9h2kb.aspx

asp.net web services do not support aspcompat, so you must create your
own sta thread and manage calls, or follow:

http://support.microsoft.com/kb/303375

also avoid storing sta objects in session as there have been a lot of
bugs with this.

-- bruce (sqlwork.com)

Sergio Martins wrote:
Hi.
I have an ActiveX DLL, developed in Visual Basic 6.0 and I need to use that
DLL inside an ASP.NET application, developed in Visual Basic .Net 2003.

My problem is that in my machine I get the error "QueryInterface for
interface ... failed" when I try to use same method of the ActiveX DLL. I try
the same application in another machine and everything works fine. I found
that if I set the "AspCompat=True" attribute in the page the application
works fine in all machines.

My questions are:

1. Why the same ASP.NET application in my machine doesn’t work without the
"ASPCompat" attribute and works in another machine?

2. There is same way to avoid using the "ASPCompat" attribute and have the
ASP.NET application working in any machine?

3. Can anyone point me an article where Microsoft describes step-by-step how
to use a Visual Basic 6.0 DLL called from an ASP.NET application? I found the
article http://support.microsoft.com/kb/811658/en-us but the focus of this
one is the debug and not the development of the solution.

Thanks in advance,
Sérgio Martins
Nov 9 '07 #2
Hi.
Thanks for your answer.
The information you give is relevant but my question is why in some machines
the same scenario (ActiveX DLL and ASP.NET application) works without the
ASPCompat attribute and in other machines don't work.

Thanks in advance,
Sérgio Martins
"bruce barker" wrote:
you must use the aspcompat feature with sta com objects (all vb6 objects
are sta). this is because asp.net is free threaded and does not honor
sta requirements.

http://msdn2.microsoft.com/en-us/library/zwk9h2kb.aspx

asp.net web services do not support aspcompat, so you must create your
own sta thread and manage calls, or follow:

http://support.microsoft.com/kb/303375

also avoid storing sta objects in session as there have been a lot of
bugs with this.

-- bruce (sqlwork.com)

Sergio Martins wrote:
Hi.
I have an ActiveX DLL, developed in Visual Basic 6.0 and I need to use that
DLL inside an ASP.NET application, developed in Visual Basic .Net 2003.

My problem is that in my machine I get the error "QueryInterface for
interface ... failed" when I try to use same method of the ActiveX DLL. I try
the same application in another machine and everything works fine. I found
that if I set the "AspCompat=True" attribute in the page the application
works fine in all machines.

My questions are:

1. Why the same ASP.NET application in my machine doesn’t work without the
"ASPCompat" attribute and works in another machine?

2. There is same way to avoid using the "ASPCompat" attribute and have the
ASP.NET application working in any machine?

3. Can anyone point me an article where Microsoft describes step-by-step how
to use a Visual Basic 6.0 DLL called from an ASP.NET application? I found the
article http://support.microsoft.com/kb/811658/en-us but the focus of this
one is the debug and not the development of the solution.

Thanks in advance,
Sérgio Martins
Nov 12 '07 #3

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

Similar topics

2
by: Andy Norman | last post by:
I have a strange problem. When I try to call the input property of the MSXML processor object from VBScript in an ASPX page I get the error "Member not found". The same code (with a few "set"...
0
by: Sia Jai Sung | last post by:
Hi, I need to write a ASPX file that will post some request to other party (web service written in java), here is my code, <%@ Page aspcompat=true %> <% Dim xml, url
3
by: Angelo Brusati | last post by:
When using VB6 COM objects on a ASP.NET page, and having the @Page directive with the AspCompat attribute set to true, it causes an error like "Method '~' of object '~' failed" or "Object reference...
1
by: Neeraj | last post by:
I am using AspCompat="true" in the page directive from where I am calling Interop written in vb 6.0 which is deployed on COM+ Server. On some pages I am getting the error : Exception Type:...
0
by: Kit Truong | last post by:
The page directive: <% @Page aspcompat="true" %> is causing my web pages to hang. (Page takes a very long time to load, and finally loads with a blank page) Everything was working yesterday...
26
by: Jon Davis | last post by:
OK, why is Canvas not IDisposable, and how do I get rid of all the Windows handles? I'm doing a performance test of looping through a dynamic XAML-to-JPEG conversion. It gets to about 500...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.