"ASPCompat" attribute

G

Guest

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
 
B

bruce barker

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)
 
G

Guest

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top