mbwatkins
asked on
Keeping a form single instanced on pocket pc
I need to prevent multiple copies of the same form from being opened by a user. This is easy to do with the full .NET framework (using the System.Diagnostics.Process object to get a list of running processes and looking for the apps name twice) but the mobile framework System.Diagnostics does not include the Process object.
Anyone know of an easy way to get a list of processes on pocket pc or have an alternate solution? Thanks for any help.
Anyone know of an easy way to get a list of processes on pocket pc or have an alternate solution? Thanks for any help.
Are you currently having this problem or are you expecting to have it? If an app is running on a PocketPC and you re-execute the application, the PockePC simply re-activates the app if it doesn't have focus.
ASKER
I'm curretnly having this problem. If I select the form from the programs list, a second instance of the form definitely starts as a second process.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
create a form instance in module as a public
public objname as new frmname()
then when you want to open a form just write
objname.show
this aproch will create form instance just a single time
public objname as new frmname()
then when you want to open a form just write
objname.show
this aproch will create form instance just a single time
ASKER
The main problem was caused by debug mode. You can open a second instance of the installed app behind a running debug instance. The semaphore solution would've worked as well.