|
-
Jan 12th, 2011, 07:27 PM
#1
Thread Starter
Lively Member
-
Jan 12th, 2011, 07:49 PM
#2
Re: Problem that has me going crazy.
Perhaps it would be a good idea if you include which version of vb.net you are using. I tried opening the project in VS2008 and it didn't open.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 12th, 2011, 07:52 PM
#3
Thread Starter
Lively Member
Re: Problem that has me going crazy.
 Originally Posted by Nightwalker83
Perhaps it would be a good idea if you include which version of vb.net you are using. I tried opening the project in VS2008 and it didn't open.
I'm sorry. I ended fixing my problem i was going to origonally post so i rewrote my psot and i forgot to leave that part - Anyways i use 2010 and you can open it in 2008 by opening OfficeMonkey 2.1 (BETA).sln in notepad and changing
Microsoft Visual Studio Solution File, Format Version 11.00
to
Microsoft Visual Studio Solution File, Format Version 10.00
I think i got he number write. I'm sorry i forgot to mention this
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 08:00 PM
#4
Thread Starter
Lively Member
Re: Problem that has me going crazy.
Did i post this in the wrong forum? I think i may have but not to sure? I have never been clear on what Visual Basic is classified as. Can anyone clarify that for me too?
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 08:16 PM
#5
Re: Problem that has me going crazy.
There are two main types of VB com and .net! VB6 is com and VB 2002 to now are .net. They use a different way of doing things.
Edit:
I found this code here which, checks for the previous instance of a loaded application.
VB Code:
Imports System.Threading
'Form level declaration
Public Class Form1
Dim objMutex As Mutex
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
objMutex = New Mutex(False, "SINGLE_INSTANCE_APP_MUTEX")
If objMutex.WaitOne(0, False) = False Then
objMutex.Close()
objMutex = Nothing
MessageBox.Show("Instance already running")
End
End If
'if you get to this point it's frist instance
'continue with app
End Sub
End Class
Last edited by Nightwalker83; Jan 12th, 2011 at 08:48 PM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 12th, 2011, 09:13 PM
#6
Thread Starter
Lively Member
Re: Problem that has me going crazy.
Thank you for that. And thank you for that bit of code. I may end up having to do that but I am wondering why its even launching two instances when i want it to restart
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 09:49 PM
#7
Re: Problem that has me going crazy.
I'm not sure I have never used the restart method before.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 12th, 2011, 09:57 PM
#8
Thread Starter
Lively Member
Re: Problem that has me going crazy.
Okay, I created a quick test porgram with a button that called app to restart. Works like it should closes and reloads. So i am now wondering if its the timer i have in splash scrren? Going to experiment.
Last edited by crazy1993; Jan 12th, 2011 at 10:19 PM.
Reason: Merge posts
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 10:15 PM
#9
Thread Starter
Lively Member
Re: Problem that has me going crazy.
Now i got this:
I skipped the config screen and disable timer and go right to main, then close the splash. i added a button to main and added application.restart to its click event. When i click it here it restarts and i end up with one instance? This is weird. it may be my configuration wizard but i havn't figured out how or whats my prbolem. Going to try the button on welcome screen (initalizer)
EDIT
Okay? It works as expected on welcome screen to. I don't understand what I'm doing here that makes it do this? Can anyone offer a suggestion?
Last edited by crazy1993; Jan 12th, 2011 at 10:20 PM.
Reason: Adding
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 10:49 PM
#10
Thread Starter
Lively Member
Re: Problem that has me going crazy.
Okay guys i seemed to have found a workaround. I noticed when running debugging and doing line by line when i called app restart it reran the formclosing event and i think thats what causing my problem. But i added an END in after the app restart. some reason the fist time through it gets to app restart and goes back up to start of sub, makes sense because cmd sen is basicly tell the form to close, and this time it goes to the end. somereason i still only end up with one intance now but not sure this is a goo dwork around. sinsee it ends up dong same task twice. so i hink i am going to try and redo the way the form handles closes
If any one has more suggestions let me know please
Last edited by crazy1993; Jan 12th, 2011 at 10:56 PM.
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 11:03 PM
#11
Re: [Somewhat Resolved] Problem that has me going crazy.
Instead of using End you could also use:
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 12th, 2011, 11:06 PM
#12
Thread Starter
Lively Member
Re: [Somewhat Resolved] Problem that has me going crazy.
 Originally Posted by Nightwalker83
Instead of using End you could also use:
That may work better to close it more peacefully. I was reading just a minutea go that i shouldn't use END because of messy closes? Anyways. I am going to try that. I am currently trying to....Well i'm not really sure lol
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 11:07 PM
#13
Thread Starter
Lively Member
Re: [Somewhat Resolved] Problem that has me going crazy.
vb Code:
If closer = 0 Then 'Sees if we are to the end of the wizard Dim int As MsgBoxResult int = MsgBox("If you close the configuration wizard you won't be able to use officeMonkey." + vbNewLine + vbNewLine + "Exit?", MsgBoxStyle.YesNo + MsgBoxStyle.DefaultButton2 + MsgBoxStyle.Question, "OfficeMonkey Configuration") If int = MsgBoxResult.Yes Then e.Cancel = False Else e.Cancel = True End If ElseIf closer = 1 Then 'if we did then save settings, restart program saveloadsettings(0) My.Settings.setup = True My.Settings.Save() closer = 2 Application.Restart() ElseIf closer = 2 Then e.Cancel = False End If
Currently working closeing method.
Going to try app exit now as nightwalker suggested
EDIT
Hmm, Well still nothing. I think i get why its doing it the way its doing it. Just thinking that i can prob just change closer to something other then whats in the statements skips the ifs all together 2nd time around so therefore it just closes
Last edited by crazy1993; Jan 12th, 2011 at 11:14 PM.
Reason: Adding - Spell Check a little
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 12th, 2011, 11:16 PM
#14
Thread Starter
Lively Member
Re: [Somewhat Resolved] Problem that has me going crazy.
Code:
Private Sub Setup_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If closer = 0 Then 'Sees if we are to the end of the wizard
Dim int As MsgBoxResult
int = MsgBox("If you close the configuration wizard you won't be able to use officeMonkey." + vbNewLine + vbNewLine + "Exit?", MsgBoxStyle.YesNo + MsgBoxStyle.DefaultButton2 + MsgBoxStyle.Question, "OfficeMonkey Configuration")
If int = MsgBoxResult.Yes Then
e.Cancel = False
Else
e.Cancel = True
End If
ElseIf closer = 1 Then 'if we did then save settings, restart program
saveloadsettings(0)
My.Settings.setup = True
My.Settings.Save()
closer = 2
Application.Restart()
End If
End Sub
Final code seems to work as needed. Marking thread as resolved. Thanks guys!
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Jan 13th, 2011, 06:29 AM
#15
Re: [RESOLVED] Problem that has me going crazy.
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
(thanks for letting us know Nightwalker83 )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|