It's obvious that we going to develop our custom control in IWBasic's IDE. So, this short discussion is more about the details of how we are going to go about that.
We previously stated that we've going to share our custom control as a static library. And we know that the user will have to have a '$USE "OurLib.lib" statement somewhere in there source code in order to be able to use our custom control. It would seem to follow that we would need the same sort of arrangement while we are testing our custom control as we develop it.
- We create an IWBasic project, with the Project Type as 'Static Library'.
- We create an IWBasic source file to contain our actual custom control code. Note: We must acknowledge that there is absolutely no reason why we can't use more than one source file for our control.
- We add our source files to the project.
- We create a separate source file as a 'Windows' type exe that we will use for testing our library.
- We create an include file that has the available functions we can call from our library, along with any supporting constants..
- We add the include file to our testing file.
- In either the include file or the testing file we add our '$USE' directive.
- Open our control project.
- Compile the project to create the .lib file.
- Open our testing program.
- Make any changes in order to do the appropriate testing.
- Compile and run our testing program.
- Reopen our project to make the next set of changes to the control and repeat this process.
As can be seen from this sequence, for each set of changes during development, we have to open and close the library project and compile both the library project and our testing file. Not very efficient.
- Create an IWBasic project, with the Project Type as 'Windows EXE'.
- Create an IWBasic source file to contain our actual custom control code.
- Create an IWBasic source file that contains our testing code with the $MAIN directive at the top.
- Add both files to our project.
With this arrangement we don't have to keep opening and closing a project between edits and we only have to perform one compile per set of edits.
After we have completed the development then we can separate the testing file from the custom control file. The control portion can then be added to a new project in order to create the lib file. The testing file can possibly be modified to become an example file (with the addition of the proper include file and directives).
Before this tutorial is finished the reader will have examples of all phases of this total process.