473,406 Members | 2,259 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,406 software developers and data experts.

VB.Net web service referencing ActiveX dll

Robc9999
I am using an ActiveX dll that I have tested succesfully from a VB.net desktop application.

When I attempt to wrap the application in an ASP.Net web service I can't get it to function.

There are 2 potential issues.

1) Dll references a config file stored in the application directory.
2) DLL runs a telnet session on port 23 to a remote client

I guess these both have the potential to cause a problem with security settings.

In an attempt to get it to function I have changed machine.config to use the SYSTEM user - but this doesn't seem to help.

<processModel enable="true" userName="SYSTEM" password="AutoGenerate"/>

Any suggestions on what the problem might be would be appreciated.

Thanks
Rob
Jun 5 '07 #1
5 3332
Plater
7,872 Expert 4TB
What errors are you getting?
Is the object COM visible?
Does the object have all it's little GUID and stuff registered?
Is the object going to be used client side or server side?
Jun 5 '07 #2
The object I'm using doesn't have a user interface.

Its function is to provide a COM wrapper for a 3270 datastream from a mainframe session, (aka screen scraping)

My code is as follows;

<WebMethod()> _
Public Function Image() As String

Dim strConfigFile As String

Dim HIOsessions As PASSHIOLib.OhioSessions
Dim HIOsession As PASSHIOLib.OhioSession
Dim HIOscreen As PASSHIOLib.OhioScreen
HIOsessions = New PASSHIOLib.OhioSessions
strConfigFile = "C:\Inetpub\wwwroot\HIOws2\LOCIS.zcc"
HIOsession = HIOsessions.AddSession(strConfigFile, 1)
HIOsession.Connect()

If HIOsession.isConnected = False Then Return "Unable to Connect to Host"

HIOscreen = HIOsession.Screen
Return HIOscreen.String
End Function

After Connect method is called isConnected should return true if all OK - but it doesn't.

If I change the path to the config file (LOCIS.zcc) I get a file not found error which leads me to believe that the ActiveX.dll can find the config file and I know this works from my desktop app.

I believe my problem may be that the ActiveX.dll is not able to open a telnet session to the remote server.

Other than running with userName="SYSTEM" is there some thing else required to allow access to network functions ?

Thanks for your assistance
Rob
Jun 5 '07 #3
This is the specofic error I get if I don't test isConnected.

System.Runtime.InteropServices.COMException: Session is not connected to host.
at PASSHIOLib.OhioScreenClass.get_String()
at Service.Image() in c:\inetpub\wwwroot\HIOws2\App_Code\ScreenStatus.vb :line 41
Jun 5 '07 #4
Appears to be a timing issue.

Added,

System.Threading.Thread.Sleep(4000)

before checking connection and it works.
Jun 5 '07 #5
TRScheel
638 Expert 512MB
Appears to be a timing issue.

Added,

System.Threading.Thread.Sleep(4000)

before checking connection and it works.

It might be wise to put the check for connection into a loop, and have it run say 10 times at a sleep interval of 1000. If during the loop it connects, break, if it doesnt then after 10 seconds it has truely timed out.

This is IF the object you are using does not have a function that you can call that will hold the program at that point until the object is connected or timed out.
Jun 5 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Vincent Finn | last post by:
Hi, I have a Windows service written in C# I want to access it from a C# app (or a C++ app for that matter) How can I do this? I tried referencing it but it fails telling me the it's not a...
5
by: SPG | last post by:
Hi, We have a C# app that uis running as a service. It uses a third party activeX dll that we us to capture events. Because it is an activeX dll, we have to create our own message pump on a...
18
by: jayderk | last post by:
a customer was trying to install some of our software after they installed the windows XP service pack 2 and he is getting a message that says something about it not being compatable with windows...
5
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown :...
3
by: Michiel | last post by:
Hello, I have an ActiveX control which I can call fine from HTML pages, using the object tag like <OBJECT ID="UserControl1" WIDTH="0" HEIGHT="0"...
0
by: Frank | last post by:
I am attempting to convert an asp file to a asp.net file using C#. The original file has an ActiveX control which is contained in a cab file. The cab file contains the .ocx file which connects...
3
by: Joseph Geretz | last post by:
Our application is primarily VB6, however we are migrating toward .NET and a newer architecture. For the time being though, we're stuck with a hybrid approach with our ActiveX client application...
1
by: jreddigari | last post by:
I want to call a Activex exe from .NET Webservice. I want to configure the server of activex exe in the web service (if tomorrow that Activiex exe is moved to some other location I do not want to...
2
by: =?Utf-8?B?Sm9obiBG?= | last post by:
Hello All, I have a question about using an ActiveX control with a Windows Servce in C#. I believe it is not possible to properly setup an ActiveX control in a windows service as the particular...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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,...
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.