Code you write with a compiler is your own. However, libraries that you link to are not necessarily yours, dlls, objects, third party objects.
If you read the 'Agreement' document that comes with your compiler you will see that you are given commercial rights for programs written that include thier libs/objects that came with the compiler, unless otherwise stated. Even OWL could be distributed in thie way.
It is third party objects, for example Macromedia Flash Factory , Crystal Reports or maybe a datagrid object, that you have to be careful with. They are varying degrees of participation that are allowed depending partly on the vendor and partly on the use of their objects.
I wrote a very nice reporting tool using Crystal reports and didn't mind at all paying a licence fee to them for its use, because it saved me a lot of work. My product wasn't commercial, but it was for distribution throughout a company.
It is best to concider the vendor at the time of designing your code. When you find an object you would like to use, check the documentation on it (often in its properties) to see who owns it, that way you can find out if its royalty free.
Don't shy away from something you feel your design needs though, often it is worth coming to an agreement with the designer on licencing rather than trying to reproduce what they have already written.
Note. The 'DarkBasic' in my email is only so I can seperate my emails. Don't go thinking I'm a clever mega brain who wrote any of this stuff.