473,395 Members | 1,516 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.

"There are no more endpoints available from the endpoint mapper" First chance exception

Hi,

When I load my application I get the the above first chance exception.

Stepping through my code it appears to be on the last line of the these two
lines

Process current = Process.GetCurrentProcess();

Process[] processes = Process.GetProcessesByName (current.ProcessName);

Any idea wither I need to worry about it (I'd rather it didn't except) and \
or how to fix this.

INFO: What I'm trying to do with this code is see if the application is
running already and if it is post a

message to it's window and not run a second instance. (if it doesn't exist
I call my forms constructor).

I don't appear to get the exception if the process is already running.




Nov 15 '05 #1
2 10002
rollasoc,

What platform are you running this on? I think that the implementation
of GetProcessesByName is different depending on the platform (not that you
should ever know or care about it though).

However, for what you are doing, there is an easier way. I would create
a named Mutex instance, and then see if you can get a lock on it. If you
can, then you know your application is not running. If you can't get a
lock, then don't run the app. Basically, place an if block around the call
to the static Run method on the Application class, only entering if you can
obtain the Mutex.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"rollasoc" <ho*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

When I load my application I get the the above first chance exception.

Stepping through my code it appears to be on the last line of the these two lines

Process current = Process.GetCurrentProcess();

Process[] processes = Process.GetProcessesByName (current.ProcessName);

Any idea wither I need to worry about it (I'd rather it didn't except) and \ or how to fix this.

INFO: What I'm trying to do with this code is see if the application is
running already and if it is post a

message to it's window and not run a second instance. (if it doesn't exist I call my forms constructor).

I don't appear to get the exception if the process is already running.



Nov 15 '05 #2
Windows 2000 5.00.2195 Service Pack 4

I'll look into the idea of using a mutex, since I am already doing this to
fix a slight fault where clicking many times on the exe, caused the app not
to run at all (since each instance saw another instance in the process list
and exited).

If what you say is correct I should be able to get away with simplifying my
code somewhat.

Thank you.

Rollasoc


"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:#D**************@TK2MSFTNGP11.phx.gbl...
rollasoc,

What platform are you running this on? I think that the implementation of GetProcessesByName is different depending on the platform (not that you
should ever know or care about it though).

However, for what you are doing, there is an easier way. I would create a named Mutex instance, and then see if you can get a lock on it. If you
can, then you know your application is not running. If you can't get a
lock, then don't run the app. Basically, place an if block around the call to the static Run method on the Application class, only entering if you can obtain the Mutex.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"rollasoc" <ho*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

When I load my application I get the the above first chance exception.

Stepping through my code it appears to be on the last line of the these two
lines

Process current = Process.GetCurrentProcess();

Process[] processes = Process.GetProcessesByName (current.ProcessName);

Any idea wither I need to worry about it (I'd rather it didn't except)

and \
or how to fix this.

INFO: What I'm trying to do with this code is see if the application is
running already and if it is post a

message to it's window and not run a second instance. (if it doesn't

exist
I call my forms constructor).

I don't appear to get the exception if the process is already running.




Nov 15 '05 #3

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

Similar topics

0
by: Joe Helmick | last post by:
This weird error started showing up as I was developing an email-enabled program. Once it occurs, I cannot set breakpoints in my code. Quitting Visual Studio does not help, nor does restarting my...
13
by: Alf P. Steinbach | last post by:
The third part of my attempted Correct C++ tutorial is now available, although for now only in Word format (use free Open Office if no Word), and also, it's not yet been extensively reviewed -- ...
7
by: Alf P. Steinbach | last post by:
The fourth part of my attempted Correct C++ tutorial is now available, although for now only in Word format (use free Open Office if no Word), and also, it's not yet been reviewed at all -- ...
10
by: Alf P. Steinbach | last post by:
The fifth part of my attempted Correct C++ tutorial is now available, although for now only in Word format (use free Open Office if no Word), and also, it's not yet been reviewed at all -- ...
24
by: Alf P. Steinbach | last post by:
The eighth chapter (chapter 2.1) of my attempted Correct C++ tutorial is now available, although for now only in Word format -- comments welcome! Use the free & system-independent Open Office...
1
by: Randy | last post by:
Hello All, I've got an app which performs a simple query to a web service and stores the returning data in a DataSet. The first time through it works find and as expected. The problem is that the...
1
by: Daniel | last post by:
If my System.IO.StreamWriter Write method throws "The specified network name is no longer available." and I try to Dispose or Close it in the finaly clause the close or dispose method just throws...
44
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a...
0
by: koredump | last post by:
Hi all, I have a windows app that makes some asyc calls to my webservice (WSE 3.0 with MTOM). exception gets thrown in the client win app. I know this exception is caused on the async...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.