Visual Basic Online Course - Prevent VB6 Application from run twice

Visual Basic Online Course

Limit your application to one single instance

Limit Your Application
Visual Basic Online Course - Limit Your Application
- Some applications are free trials and they're controlled using code. If you want to limit your application abilities on the client machine, then you will find those ideas great, regardless the Visual Basic Version I'm using VB6, you can still use them in .Net too.

1) Limit your VB6 Application to a certain number of times to run on the client's machine, seems sometimes to do the trick but it also can be modified easily, means your limitations can be broken easily if your client have some knowledge about programming or asked for help from a programmer. But as long as the idea is kept hidden and unknown inside the Source Code, then it would be hard to be discovered anyway. You can also limit your VB6 application setting a start Date and End Date instead of the values given in the source code below.

2) Limit your VB6 application running once only. Some application can not run more than one interface specially those which connects to a Database because you don't want to duplicate connection to an already opened Database or Tables. You will need to limit your application to only run single instance or prevent your VB6 Application from running more than once.
You will need to do those steps though,
- Add Module Module1.bas, copy the following code into it.
- Then, from Menu Project, Project Properties, Start Up Object, choose Sub Main

You can also use the 1st example to prevent your application from running twice at the same time, but the second example is much more secure then the 1st one.

VB6 Popular Posts

Visual Basic Online Course - Excel 2003 Part 1

VB 6.0 Crystal Report With MS-Access 2003 - PassWord Problem

Visual Basic Online Course - Analog Clock in VB6