A computer program, in general, is not considered to be patentable in Canada. The Canadian Intellectual Property Office takes the view that that the software is an abstract scheme or set of rules for operating a computer and, as a result, is not considered an invention. But, under some circumstances it may be possible to obtain a patent for software if the claims of the patent are worded in a particular way. This is one of those instances where it is probably a good idea to have a patent agent involved as they will be much more likely to be able to draft a set of claims that would be considered acceptable subject matter by the Patent Office. In addition to the properly worded claim, your software must also meet the criteria of other patents in that it must be new, useful and non-obvious.
If your software is not considered to be patentable, you may still have some protection under the copyright laws in Canada. Copyright is an automatic protection acquired when an original work is generated. This could provide protection of your written source code, providing you with the ability to sue for infringement of your copyright if needed.
Whether by patent or copyright, it is often possible to obtain at least a modicum of protection for your software innovation. The amount of protection you are able to receive is directly proportional to the originality of your software. A highly original source code will be much more easily protected than a source code written with similarities to others. It is also important to remember that simply obtaining protection is not sufficient to prevent others from claiming you have infringed on their work.