Short answer: You cannot.
You cannot stop anyone from copying your program (until unless your seize its production). You can only make it harder for the user to reverse engineer your application.
Now as per the last part, your can have various check about the authenticity of the user. The implementation of this depends on how more cautious you are regarding the software and how much time can you spend in protecting it.
Is it worth it?
You may wish to google around finding various programs that will protect your software. There may be guides available too.
If there had been a system by which you can restrict illegal copies of your software, big companies like MS, Adobe, etc would have been implementing it on their products. But as I find, their products are also reverse engineered a lot.
If its the source code you want to protect, then the best you can do is put a copyright notice at the top of the software, then when you find someone who has stolen it you can sue him for copyright infringement. But lawyer fees might make that impractical.
Its true, it isn´t very easy to protect a software.
I have checked around on google and found some products.
I might have a mehtod I am thinking of that hopefully will cutoff and make it harder to copy the software and that would be to activate the software with example their emailaddress against a ftp server and some things to that...
I might get a look on how to connect to a ftp server and read/write a databasefile using C++ code...
Hopefully it is possible to read/write a Textfile on a ftp.server.
one problem will always exist. there are a lot of people like us out there and every time one of us comes up with a brilliant idea its just a matter of time before a another person comes up with a way to break it. take windows xp for example they came up with a way to have to activate the software but now you can google programs out the wazoo that will generate keys to activate it.
Yes that is really a problem.. It is kind of a impossible mission in a way... The problem is that it probably will be a crackversion out on the net after a while if the software seems interesting how brilliant your idéa even was.