Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21242

application hang problem

$
0
0
I have code below to check for piracy of my software. Though it is not the best out there but perhaps way to make it harder or annoying to be pirated.

Code:

Public Sub CheckForPiracy(num As Long)
    Dim PauseTime, Start
    PauseTime = num 
    Start = Timer 
   
    Do While Timer < Start + PauseTime
        DoEvents  ' Yield to other processes.
    Loop
   
    Call chknw  'This will check if the license is available, expired o correct.  If not, shutdown the
   
    Dim i As Long
    i = RandomNumber(7200, 300)
    CheckForPiracy(i)              'repeat the procedure
End Sub

I call the above procedure on mdiform form_activate event. But I notice that the toolbar on my mdiform hangs until I open up a new form where the whole app gui is refreshed.

chknw procedure is an if statement checking the existence of license file, comparing license from license file and checking expiry date from license file. I dont think this causes application to hang.

Can you advice me how I can optimize that code in order not to cause application hang.

.

Viewing all articles
Browse latest Browse all 21242

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>