Hello, Nov 18/01 This is a small taste of the Object Orientated Programming model developed specifically for MASM32 and Hutch's Win32ASM package. The model was designed by Jaymeson Trudgen (NaN) and Thomas Bleeker (Thomas) and is provided open sourced for learning purposes ONLY. © Sept 19, 2001. Any commercial profit involving the use or distribution of software generated by our MASM32 OOP model is strictly prohibitted unless written consent is provided by BOTH Jaymeson Trudgen and Thomas Bleeker. If objects become a major portion of any project, please make an attempt to acknowledge the use of our work by any means, thank you. The Model (Objects.inc): ------------------------- To learn how the model works its is advised to read over the OBJECTS.INC source briefly (dont study it too hard the first time through) to get a feel for what is provided. Then study the simple example of how some of the model's features are put to use in the CSprite example provided. There is only two things to really notice in this example with regard to learning how the model works: 1) The CSprite class structure (which can be generated automatically with the Object creator tool to make life easier!), and 2) Creating, calling methods, and Destroying objects in normal sequencial coding. The most used macro's to look for are : NEWOBJECT, METHOD, and DESTROY. They are used primarialy in your nonrmal squencial coding to get objects created, working for you, and destroyed when needed. There are other macros that are specific to the design of object classes, such as: OVERRIDE, SUPER, SET_CLASS, CLASS, BEGIN_INIT, CMETHOD etc. etc. These are provided to keep the needed set up code simple in design. Please eventually study these macro functions, they will save you alot of guess work when writing your own class files. Lastly, there is $() methods also provided. They are advised to be used when experienced with the model and understand fully how the model functions. They will make your code smaller in some cases, but its possible to hide how data is being moved about and make debuggin less obvious. So be warned :) I personally enjoy their uses so i do encourage you to eventually learn to use them as well :) The Example(s): CSprite & CSmiley ---------------------------------- NOTE: Always read the README first! There is two examples provided, written by Thomas Bleeker. It shows you some of the functionality the OOP model can provide. The first example is fully provided in the CSmile directory. It is broken into simple "chunks" for studying. Most of the sources are standard MASM coding except periodic method calls to work on CSprite instances. This example shows the very basic OOP model, constructor, destructor, instance variables, and methods. They are brought together in CSprite.asm to make a sprite class that is self contained and able to be used to manage many sprites at once (GDI graphics). Please read the CSprite.html and study the CSprite.asm file. The second example shows primarialy inheritance. Rather than re-writing a new TYPE of sprite class, inheritance will make use of the base class (CSprite) and extend it to include another feature, to provide foot steps where the sprite has been as well!. This example shows how the SUPER macro can be used to maximize code reuse, how to make a polymorphic method (draw method), and how to set up inheritance in general. This example is contained in a separate directory within the CSprint directory, and requires some setup to compile (( READ THE README in this directroy, the steps are simple )) The included Tools: Object Creator v1.6, and OOP2HTML v1.6 ----------------------------------------------------------- These two tools are to help your create and organize objects. The Object creator is somewhat basic, but effective. It will create for you an empty Class framework complete with headers compatible for the OOP2HTML tool. The framework will be built as instructed by the creator and only function code will need to be manually added in the methods. NOTE: There is no edit feature, so modifications must be done manually (IE, inserting a new method). Sorry for this, but there IS a new version coming soon to accomodate this drawback and make OOP even easier to use! :) The OOP2HTML tool is quite simple to use. It will look for "#xxxxx" statements only within the commented area of a OOP Class file and extract the comments into an orgainized HTML file. By properly documenting the class and methods with these #xxxx statements, a neat and orgainized HTML reference for the class can be created by draggin and droping the file on to the OOP2HTML window. The output HTML file is automatically generated in the same directory. This too adds to OOP's strength because proper documentation of classes and their methods can allow for better class reuse in the future (by providing proper information in the header/html to reuse a class properly). HeLp? Resources? ----------------- NOTE: There is a VERY basic text example of how objects work on Thomas' downloads page. (simpler than the two included, but rather boring to look at :) Theses are only two examples, if your have an inquiry on how to do other stuff with our model, or looking for other examples please visit our web sites to get the latest updates and examples: http:\\nan32asm.cjb.net\ (Nan's homepage - a sort of "work in progress") http:\\exagone.cjb.net\ (Thomas' homepage - good downloads) or Email either of us: jaymeson@hotmail.com (Jaymeson Trudgen) ska-pig@gmx.net (Thomas Bleeker) OOOR... Ask as many questions as you can think of in the COM section of the windows 32 assembly message board, we both visit almost daily: http:\\win32asmboard.cjb.net (Windows 32 Assembly message board) ------------- Happy Coding! NaN