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

Using server-side OCX control with ASP.Net Web Service

las
(Originally posted to framework.aspnet.webservices, but I am casting a
larger net and trying again)

I am using a library supplied by a third-party vendor. Although the
library has no UI, the vendor supplies it as an .OCX control.

I need to utilize this library in an ASP.Net Web Service. My Web
Service does not expose the OCX control's functionality directly, but
utilizes the OCX for its own internal purposes.

What is the best approach here?

Since I am more familiar with old VB6 than with .Net, I was thinking of
wrapping the OCX with an ActiveX server written in VB6. This ActiveX
server would provide the hidden form that the OCX requires. I would
then utilize the ActiveX server from ASP.Net via interop.

Does this make sense? How would I do this using just .Net -- without
getting VB6 involved?

TIA!
Lee

Mar 31 '06 #1
8 1626
you have a couple issues. asp.net webservices do not support sta com objects
(like ones built in vb6). you should host then in com+, or create your own
sta thread that manages calls to the ocx.

-- bruce (sqlwork.com)


<la*@labapps.com> wrote in message
news:11**********************@t31g2000cwb.googlegr oups.com...
(Originally posted to framework.aspnet.webservices, but I am casting a
larger net and trying again)

I am using a library supplied by a third-party vendor. Although the
library has no UI, the vendor supplies it as an .OCX control.

I need to utilize this library in an ASP.Net Web Service. My Web
Service does not expose the OCX control's functionality directly, but
utilizes the OCX for its own internal purposes.

What is the best approach here?

Since I am more familiar with old VB6 than with .Net, I was thinking of
wrapping the OCX with an ActiveX server written in VB6. This ActiveX
server would provide the hidden form that the OCX requires. I would
then utilize the ActiveX server from ASP.Net via interop.

Does this make sense? How would I do this using just .Net -- without
getting VB6 involved?

TIA!
Lee

Mar 31 '06 #2
Don't use VB6! Just add a reference to this OCX. In solution explorer,
right click "References" and add it.

Wait, the control requires a form?? In a web service? Won't work.

Mar 31 '06 #3
las
Thanks for the heads-up on STA! I had threading in the back of my mind
but had not yet gotten around to researching it -- maybe I was just
afraid of what I would find <grin>

Mar 31 '06 #4
Sure it does, all you have to do is set the "aspcomp" attribute to true at
the page level.

Willy.

"Bruce Barker" <br******************@safeco.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
| you have a couple issues. asp.net webservices do not support sta com
objects
| (like ones built in vb6). you should host then in com+, or create your own
| sta thread that manages calls to the ocx.
|
| -- bruce (sqlwork.com)
|
|
|
|
| <la*@labapps.com> wrote in message
| news:11**********************@t31g2000cwb.googlegr oups.com...
| > (Originally posted to framework.aspnet.webservices, but I am casting a
| > larger net and trying again)
| >
| > I am using a library supplied by a third-party vendor. Although the
| > library has no UI, the vendor supplies it as an .OCX control.
| >
| > I need to utilize this library in an ASP.Net Web Service. My Web
| > Service does not expose the OCX control's functionality directly, but
| > utilizes the OCX for its own internal purposes.
| >
| > What is the best approach here?
| >
| > Since I am more familiar with old VB6 than with .Net, I was thinking of
| > wrapping the OCX with an ActiveX server written in VB6. This ActiveX
| > server would provide the hidden form that the OCX requires. I would
| > then utilize the ActiveX server from ASP.Net via interop.
| >
| > Does this make sense? How would I do this using just .Net -- without
| > getting VB6 involved?
| >
| > TIA!
| > Lee
| >
|
|
Mar 31 '06 #5
las
Bruce,

Reviewing the @Page directive, it looks like it can only be used on ASP
Web Forms.

Can aspcompat be set for a web service, or is there something
comparable for a web service?

Thanks,
Lee

Mar 31 '06 #6
las
Sorry, I meant to address that last question to Willy.

Mar 31 '06 #7

<la*@labapps.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
| Bruce,
|
| Reviewing the @Page directive, it looks like it can only be used on ASP
| Web Forms.
|
| Can aspcompat be set for a web service, or is there something
| comparable for a web service?
|
| Thanks,
| Lee
|

You are right, it only applies to web application not web services. Web
services cannot handle STA threads nor should you ever try to run OCX
components in web applications at all, there isn't such a thing like server
type OCX's , even if they don't have an UI, they have at least one hidden
window and this window's message queue need to be pumped and dispached.
Nothing in the web framework will do this for you, this result in high
memory consumption leading to process recyling and possible deadlocks.
Willy.
Apr 1 '06 #8
las

I just got a communication from the vendor -- it seems their OCX can be
instantiated without a hidden window.

That good news solves the hidden window nastiness described by Willy,
but I guess I still must resolve the STA issue.

I've got some custom connection pooling issues to deal with too, so
I'll probably bundle the STA and connection pooling solutions together.
Looking into COM+ now, but I may just fall back on my old-school roots
and create an out-of-process activeX server.

Thanks Bruce and Willy for your feedback,
Lee

Apr 3 '06 #9

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

Similar topics

2
by: Yves Touze | last post by:
Hi All, I'm trying to migrate from SQL Server 7.0 to SQL Server 2000. I've got some ASP page which call VB components that retrieve shaped recordsets from SQL Server using the MSDATASHAPE...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
1
by: Siddharth Jain | last post by:
hello I am trying to enumerate the shared folders on a server using the NetShareEnum function. Now, when the server has a password set to access the shared folders, the function returns system...
8
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL...
0
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: dixonjm | last post by:
Hi, I have a master page & various pages that will use this master page. Each content page will have a CSS & JS file which will be named the same as the content page. When I try to load the CSS...
4
by: MissElegant | last post by:
Hi all, I have tried to do a test to a lesson which was in the internet, but it doesn't work? ANYBody here to help please?? The problem that what I enter in the textbox should be sent to the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.