473,811 Members | 3,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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 "QueryInter face 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 2131
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 "QueryInter face 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 "QueryInter face 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
1859
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" statements added) works find in ASP. What on earth is going on ? I can't find anything in the knowledge base on it.
0
4233
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
1580
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 not set to an instance of an object". The scenario is: - Windows 2003 server - IIS6 - Framework 1.1
1
1611
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: System.Web.HttpUnhandledException Info: System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> SCTMatrixExceptionMng.MatrixException: COM object with
0
2319
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 and as far as I can tell no changes occured to the server.
26
3607
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 conversions and then crashes. Task Manager says that about 6000 Windows handles were created and the count never decrements. My code (loop not shown):
0
9731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.