473,661 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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.GetCurr entProcess();

Process[] processes = Process.GetProc essesByName (current.Proces sName);

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 10018
rollasoc,

What platform are you running this on? I think that the implementation
of GetProcessesByN ame 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.co m

"rollasoc" <ho*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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.GetCurr entProcess();

Process[] processes = Process.GetProc essesByName (current.Proces sName);

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.c om> wrote in
message news:#D******** ******@TK2MSFTN GP11.phx.gbl...
rollasoc,

What platform are you running this on? I think that the implementation of GetProcessesByN ame 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.co m

"rollasoc" <ho*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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.GetCurr entProcess();

Process[] processes = Process.GetProc essesByName (current.Proces sName);

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
4469
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 machine. In desperation, I reinstalled the .NET framework 1.1 this morning, and the error didn't occur on the first few test runs of my program; I was getting happier. But then it started happening again! I cannot figure out how to make it...
13
2223
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 -- comments welcome! "Intro to loops" <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_03.doc> As before I expect that here's mental food and technical points that we can strongly disagree about, for both newbie and the experienced.
7
1584
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 -- comments welcome! "Decisions & conditions" <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_04.doc> Different from before I don't expect that this part contains mental food and technical points that we can strongly disagree about, so I'm...
10
2049
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 -- comments welcome! "How to use libraries" <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_05.doc> General URL: <url: http://home.no.net/dubjai/win32cpptut/html/>
24
2553
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 if you don't have Word. Classes <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_02_01.zip> Introduces the C++ language feature used to define new types, namely classes. The focus in on creating safe and reusable classes. As a main
1
5642
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 second time I step through and I step on the line myDataAdapter1.Fill(tempds); I get the IDE error... "There is no source code available for the current location". If I run the app (not under the debugger) I get no error messages but this...
1
5509
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 "The specified network name is no longer available." again. how to clean this up? after this the stream writer is stuck connected until i restart my process.
44
4188
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 good concept?
0
2165
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 completed call back, but I have not been able to catch it and dispose of it. How can gracefully handle this exception?
0
8428
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
8341
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
8851
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...
0
8754
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
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,...
1
6181
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...
0
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1740
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.