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

attaching to COM process in windows service

I am having a serious problem connecting to out-of-process COM objects in my windows service application. Whenever I try to create an instance of the COM object, a second instance of the COM server is started up instead of attaching to the already running one. I have tried the following fixes with no results:

1. added these lines to my service:

System.Threading.Thread.CurrentThread.ApartmentSta te = ApartmentState.STA;
int ret = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero, 4, 3, IntPtr.Zero, 0, IntPtr.Zero);

2. ran dcomcnfg.exe and changed Default Authentication Level to Default and Default Impersonation Level to Impersonate.

3. Changed the "Log On" settings for the service to use my account/password.

None of these change the situation - however, I still feel it may be a security issue. If I run my app NOT as a service, it works fine.

What's going on here???

Matt

Nov 15 '05 #1
0 873

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

Similar topics

0
by: Trokey | last post by:
I am having a serious problem connecting to out-of-process COM objects in my windows service application. Whenever I try to create an instance of the COM object, a second instance of the COM server...
0
by: belgi | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
3
by: belgiozen | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
4
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
4
by: Mrinal Kamboj | last post by:
Hi , Doubt may be bit trivial , but i wanted to know , what are the exact benefits derived while we run a background process as an NT service in windows , we can as well achieve the...
1
by: Mark Kamoski | last post by:
Hi-- All of sudden (?) the VS.NET v1 IDE is NOT automatically attaching aspnet_wp.exe as a debugged process. Why? Here is the situation. VS.NET (v1)
4
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at...
5
by: Benzi Eilon | last post by:
I have written a C# application which should run as a Windows Service. I must avoid having multiple instances of the application on one machine so I inserted the following code at the beginning of...
3
by: Rico | last post by:
Hello, I have a windows service that I have created in VB 2005. I have it installed, and running, but it's not functioning correctly. When I try to "Attach to process", my service is greyed...
4
by: Steven De Smet | last post by:
Hello, This is my first post. I searched on the internet for answers but I was unable to solve my problem. So I hope that you guy's can help me with my VB.NET problem I tried to create a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.