Is it possible to statically link the GD DLL with your main executable? Let's try and avoid the "but they are DLLs because they are supposed to be shared!" arguments
Can it be done? Thanks!
Static linking?
Only if Johan decided to provide a static library for GapiDraw. I doubt this would happen because of the ease with which GapiDraw could be illegally used in projects - the DLL offers some form of monitoring applications using the API. Obviously the DLL also provides the advantage of smaller EXE file sizes if you have multiple applications using the same DLL version.
All true. It would be a trivial matter however to watermark the DLL, and that would be rather difficult to get rid of because the tools to do so don't exist for PocketPC (I'm thinking EXE encryptors and compressors, etc.). Johan, is this something you might be able to provide for paying customers (after they have paid naturally)?
Ultimately this isn't a big deal, but I always prefer a completely self-contained EXE to a bunch of required support files (I'm kind of old-school with the "just copy the files over" installation mentality). No biggie either way though, just exploring options.
Ultimately this isn't a big deal, but I always prefer a completely self-contained EXE to a bunch of required support files (I'm kind of old-school with the "just copy the files over" installation mentality). No biggie either way though, just exploring options.
Due to the numerous requests we have had we will release statically linked libraries with the next release of GapiDraw (3.5) for site licensees. Many larger companies developing applications for Symbian mobile phones have expressed the need for statically linked libraries, and the Palm version is already being distributed as a statically linked library due to shared DLL restrictions in Palm OS. Hopefully giving site licensees a bit "more" than product licensees will perhaps motivate enough people to buy the site license instead of simply 2-3 product licenses a year.
One advantage I see with LIB files is the easy of use for us when releasing new versions. Right now we have to change each project file and sample to reflect the updated DLL name, which takes time. Using LIB files, we could simply name it gapidraw.lib and be done with it. I will give it some more thoughts and investigate if it would be possible to watermark the LIB file in an easy way.
The typical way of watermarking is to have some strings that look like garbage embedded in the code... This can be accomplished by literally declaring a string in your code that you never use.
Then, calculate a checksum for your file. There are utilities to do this, but you might need to write your own because this is where it can get a little tricky... you'll need to have the code that validates the checksum included in the file your checksumming, so you need to in a sense "subtract out" the check code (or at least the final checksum value). In other words, if you have a function to checksum your file and then do something like:
if (calculatedChecksum == theRealChecksum)
then obviously in order for you to plug in a value for theRealChecksum, you would need to have calculated it first, but since that value itself is part of the calculation... you get the point!
Therefore, you need to discount the checksum code, or at a minimum, that literal "theRealChecksum"'s value.
Then, the first call to your DLL, validate against the checksum, and then validate the embedded strings. More than one string is a good idea, but 2 or 3 should be all you need.
None of this actually will stop anyone that is really intent on using the library, but it should make it sufficiently hard that few, and hopefully nobody, will bother to try.
Then, calculate a checksum for your file. There are utilities to do this, but you might need to write your own because this is where it can get a little tricky... you'll need to have the code that validates the checksum included in the file your checksumming, so you need to in a sense "subtract out" the check code (or at least the final checksum value). In other words, if you have a function to checksum your file and then do something like:
if (calculatedChecksum == theRealChecksum)
then obviously in order for you to plug in a value for theRealChecksum, you would need to have calculated it first, but since that value itself is part of the calculation... you get the point!
Then, the first call to your DLL, validate against the checksum, and then validate the embedded strings. More than one string is a good idea, but 2 or 3 should be all you need.
None of this actually will stop anyone that is really intent on using the library, but it should make it sufficiently hard that few, and hopefully nobody, will bother to try.