|
Yes. You have two applications, that should act like a single. It's called a dirty hack.
There are enough known alternatives to the hack; instead of closing CALC when you exit, have CALC check whether you are still alive (poll using a backgroundthread) and exit if you ain't. Create a watchdog (a third app) that checks whether both are alive. Create a SERVER and send a heartbeat. Create a remote thread in CALC.exe and hide your check there.
In your case the watchdog is easiest; I'm betting a banana that your CALC is a native app and that you don't have the code.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Process[] pros = Process.GetProcesses();
for (int i = 0; i < pros.Count(); i++)
{
if (pros[i].ProcessName == "calc")
{
pros[i].Kill();
}
}
this.Close();
|
|
|
|
|
Will still not work if the app is terminated using the task-manager
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello,
This is now starting to get out of hand. Every time I have to build my project Visual Studio 10 crashes on me without telling me why. I have tried starting Visual Studio with writing a log file in the command prompt. And starting Visual Studio in SafeMode in the command prompt.
The log file does not show that anything went wrong and Safemode didn't help because I got the same results: crash.
My suspicion is that one of my many references (dlls) might be corrupt or faulty. Should I remove them all and load them back in?
Can anyone offer some suggestions or links on how to debug why Visual Studio crashes during a build? Any help would be greatly appreciated.
|
|
|
|
|
That sounds like a tough one. Because you say, "crashes during a build" I'm assuming that you can open VS and your solution without problem. When you start the build, the problem occurs. If that's correct, I'd try watching very carefully the output window to get clues about how far the build progresses before the crash. You've probably already done that, leading to your suspicion that a dll might be the problem.
Another thing I would try is this. Delete all output files produced by a build. (Does Build / Clean still work?) Close VS and make sure everything was cleaned, or perform the task manually. Next I'd delete the .suo file. This is a hidden file in the same directory as your .sln file.
If that doesn't help, I'd hope for more suggestions from other people here.
Good luck!
BDF
I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be.
-- BillWoodruff
|
|
|
|
|
Quote: Another thing I would try is this. Delete all output files produced by a build. (Does Build / Clean still work?) Close VS and make sure everything was cleaned, or perform the task manually. Next I'd delete the .suo file. This is a hidden file in the same directory as your .sln file.
I have tried deleting some of the files, but I have not tried the .suo file. Also, I am going to retry clean and a project clean. Not sure if there is difference between the two, but at this point I will try anything to get this working.
Thanks for the feedback!
|
|
|
|
|
Could you Pls explain,what actually the problem being faced?
Regards,
Anand Deshmukh
|
|
|
|
|
Did you check your event log?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
I have not looked into the event log, but only used the Visual Studio logging method. As I mentioned before the VS log got me no where. I will try the event log this time and hope it proves more informative. Thanks for the advice.
|
|
|
|
|
You could try a re-install of VS, which may resolve it. I don't know of any published methods of debugging, but if you report the problem to Microsoft they may have some suggestions.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks for the feedback. This thought has indeed entered my mind. I may do this if nothing else works.
|
|
|
|
|
I know Microsoft get a bad press sometimes, but I had a Visual Studio problem a couple of years ago and found the response from them to be very good.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I will sure will try that. This may be a silly question, but can you link me to where I can inform MS of my frustration? Not sure if I should post it at their forums or is there a separate place that handles these type of issues?
|
|
|
|
|
|
Mine was specific to C++, but if you start here[^] you may be able to find a useful link, or at least, someone in Microsoft who can help.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i am developing application in vb.net and my application is working fine. i want to add some code to application that should get executed only when it is starting for the first time.
if anyone has done already, please let me know.
Any help is greatly appreciated.
Thanks
|
|
|
|
|
Use a Mutex[^] to check if instances of your app are already running. If not, you can execute your code.
|
|
|
|
|
It depends what you mean by first time. If you mean first time among a number of concurrent executions, then use a mutex as suggested by Shameel. If you mean first time among consecutive executions or first time ever, then you probably need to add a flag to your app.config or to the registry.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks for quick reply.
i will go as per your suggestion
|
|
|
|
|
Member 4299096 wrote: i want to add some code to application that should get executed only when it is starting for the first time.
..to setup the environment for your app? How about using an installer?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
If I get you correctly, you are talking about windows application. If yes, there is a simple approach
Unlike c#, which has a entry point "static void Main()"
VB.NET has no such stuff.
The simple trick is to add a form which you make it invisible. Write your start up code in the form load event and at the end, open your main form.
Right click Projects, go to Properties, change your startup form with invisible form you made.
Hope this helps.
cheers
|
|
|
|
|
thanks what i was looking for.
now program is running as per my need.
tank you.
|
|
|
|
|
|
If it's a blog you can get it published automatically, see here[^]. If it is a formal type of article then you need to follow the posting guidelines[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello,
I am currently making a Login System. But I wanted this option to be there that it checks for the bytes to be the same on runtime. (For potential crackers)
I tried a lot but I don't seem to find the problem.
This is just a small example code:
Public Shared Function ByteEqual
Dim first1 As Byte() = System.Text.Encoding.Default.GetBytes(My.Resources.LoginSystem)
Dim second1 As Byte() = System.Text.Encoding.Default.GetBytes(My.Resources.LoginSystem)
If first1.Length = second1.Length Then
MessageBox.Show("True")
Else
MessageBox.Show("False")
End If
End Function
This is working but I want the "My.Resources.Loginsystem" to be a certain class in my project. Is this possible without injecting?
|
|
|
|