473,779 Members | 1,921 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.RuntimeT ype.ForwardCall ToInvokeMember( String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at FOCCLib.FOCCCla ss.Connect(Stri ng serverAddr, String port)
at WindowsService1 .Service1.OnSta rt(String[] args)
at System.ServiceP rocess.ServiceB ase.ServiceQueu edMainCallback( Object
state)
_______________ _______________ _______________ __________

Please help me in resolving this issue.

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

"Jeevan" <jn******@annet site.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.RuntimeT ype.ForwardCall ToInvokeMember( String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at FOCCLib.FOCCCla ss.Connect(Stri ng serverAddr, String port)
at WindowsService1 .Service1.OnSta rt(String[] args)
at System.ServiceP rocess.ServiceB ase.ServiceQueu edMainCallback( 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
4926
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 steps: #1 compiled and installed apache using --prefix=/home/imbeauje/apache. Tested that it works.
1
2403
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, after installing those I have to install 'QMF' for SQL Server. It indicates to check Microsoft's documentation on installing QMF on SQL Server. I searched Microsoft's Website, but I did not find any information on QMF. Any ideas on the procedure...
5
2722
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 my working PC, I already have VS.Net installed, but not VS6. My question, will installing the older VS6 with VS.Net already installed give me problems with VS.Net. Or should I first remove the VS.Net, install VS6, then re-install VS.Net? Gerald
0
2633
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: file /apps/oracle/prod/9.2/lib/libclntsh.so: wrong ELF class: ELFCLASS64 I found the solution on Grig Gheorghiu's blog. Grig had similar problems when installing on UNIX, specifically AIX. You can find his
3
4123
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 installing DB2. they seems like related to java or dependent on java. Is there anyone who has faced some problem installing DB2? Do i have to install Java from expansion pack or bonus pack before installing DB2 regards,
13
8381
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 a data source string in their config files. After installing VB 6, they stopped working, producing the error "3220: The supplied provider is different from the one already in use. Changing their configuration files to specify version 3.5.1...
3
1380
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 looking in the log folder in the install folder under programs but nothing is there. Any help would be appreciated. CG
5
1632
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 that the activeX events do not fire. I installed VS NET 2003 on that machine.(in an attempt to start debuggging) Now the activeX events fire again (application works as expected ).
3
1481
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 application directory than for the existing version. Gives twice a message that a part of a directory is missing. Then everything is rolled back. Maybe the problem is linked with an installer class i use in my project.
0
937
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 "Installing..." dialog with a progress bar first, and it seems to extract information from the original setup file before showing the application. Now, my suspicion is that the Installer doesn't like files that came with the setup program to...
0
9632
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
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
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...
1
10071
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
8958
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...
1
7478
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4036
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
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.