Restart App from itself

H

Harry Simpson

I've got a LogOff menu item. I basically want to stop all processes like
the barcode reader and create a new instance of the Main form which inturn
creates the Logon form.

the code looks like this:

'Create the new frmMain instance

Dim Formmain As New frmMain

Formmain.Show()

'close the old instance

g_MainForm.Close()

g_MainForm = Nothing

When I do this it appears to work, since i'm at the Logon screen and the
scanner works but when I go the the main form, the old info is still there
like the old main form never went away. What's the trick to restarting an
app from itself.....or is this really even possible.

TIA

Harry
 
C

Chris Tacke, eMVP

The only way to achieve it is to CreateProcess on your exe, which will start
another instance. Of course you lose any instance data and the PPC itself
will try to prevent it, so you'll have to hack around that (Alex Feinman
posted a sample in the OpenNETCF Forums on it).

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
H

Harry Simpson

Thanks Chris,

You've saved some bleeding <g>
Think I'll just recreate the Logon form and clear the other info.

Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top