473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Installing C-Sharp services in Windows

Hi,

I am creating a Window Service in C-Sharp. The Window Service has a
reference to an OCX file created in VC++. In OnStart method I have created
an instance of the class, of the OCX file and called a method of the class.
Compilation was successful.

I created a Windows installer setup(.MSI), for installing the service. The
installation was successful. I started my service from the Services
Management Console. It started and stopped immediately, throwing the below
Exception in the System Application Log:
__________________________________________________ _____
Service cannot be started. System.Runtime.InteropServices.COMException
(0x8000FFFF): Catastrophic failure
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at FOCCLib.FOCCClass.Connect(String serverAddr, String port)
at WindowsService1.Service1.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object
state)
__________________________________________________ _____

Please help me in resolving this issue.

Thanks in advance,
Jeevan
Nov 17 '05 #1
1 1971

"Jeevan" <jn******@annetsite.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi,

I am creating a Window Service in C-Sharp. The Window Service has a
reference to an OCX file created in VC++. In OnStart method I have created
an instance of the class, of the OCX file and called a method of the
class. Compilation was successful.

I created a Windows installer setup(.MSI), for installing the service. The
installation was successful. I started my service from the Services
Management Console. It started and stopped immediately, throwing the below
Exception in the System Application Log:
__________________________________________________ _____
Service cannot be started. System.Runtime.InteropServices.COMException
(0x8000FFFF): Catastrophic failure
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at FOCCLib.FOCCClass.Connect(String serverAddr, String port)
at WindowsService1.Service1.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object
state)
__________________________________________________ _____

Please help me in resolving this issue.

Thanks in advance,
Jeevan


OCX objects have special requirements not fullfilled when instantiated from
Windows Services.
1. They need an STA apartment to live in, Windows Services threads are MTA
by default.
2. They need a ActiveX container as a host - for instance a Windows Form,
Windows Services don't/shouldn't provide such container as they should be
designed to run without a UI.

Or simply stated, don't try to use OCX's in non interactive applications.

Willy.
Nov 17 '05 #2

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

Similar topics

3
4907
by: Jean-Christian Imbeault | last post by:
I have a user account on a RH Linux machine but no root access. I succesfully installed apache 1.3 under my /home/ account but can't get PHP to install properly. I have done the following...
1
2392
by: SAP BASIS Consultant | last post by:
Hello, I am installing SAP R/3 on Win2000/SQL Server. There is a CD with the SQL Server RDBMS, as well as another one with SP 3A (Both are from SAP). According to the SAP installation manual,...
5
2708
by: Gerald Hernandez | last post by:
One of my development PC's died, and I need to have legacy VS and VS.Net installed at the same time. On the now dead PC, I had VS6 installed prior to installing VS.Net. This worked just fine. On...
0
2615
by: Steve | last post by:
I'm posting this message here, so that someone googling here will be able to find it. I was having problems installing cx_Oracle on Solaris. The build would fail with a message: > ld: fatal:...
3
4086
by: jaggi | last post by:
Hi all, I downloaded DB2 enterprise edition from partnerworld on ibm.com and unzipped and untarred it and copied it to CD and tried installing on AIX using SMIT. I am getting errors while...
13
8331
by: bjhartin | last post by:
All, I was working at a client's site when I installed Visual Basic 6 on a machine at their request. Existing applications on this machine had specified version 4.0 of the Jet OLEDB provider in...
3
1362
by: CG | last post by:
Trying to install this program and it gets almost done and says that the install failed and gives me the option to see the error log, setup log but when i click them nothing happens. I tried...
5
1611
by: Sagaert Johan | last post by:
hi I have the following problem: I have a C# application that uses an activeX . I installed the application and the NET 1.1 Runtimes on a clean pc When running the application i discover...
3
1463
by: Christof Nordiek | last post by:
Hi, i have a setup project, wich is configured so that new versions will automatically uninstall in older version. It all works fine, but the installation fails, if the user selects another...
0
916
by: C. Hughes | last post by:
Hi, I have used the standard tools in VS 2005 to compile my VB application into a setup file. After executing the setup file and installing the program, starting the program often presents an...
0
7223
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
7377
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...
1
7034
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...
1
5045
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.