Classic Projects - The traditional mode
To create a classic project, choose one of the Classic options. Classic projects are not visual, that is, they are traditional assembler programs, where you write all code and then build the project like in other IDE's. Anyway, Easy Code offers some advantages that make your work considerably easier, and for that reason you have to take into account some considerations in order to avoid errors:
You SHOULD NOT include WINDOWS.INC file, as it is ALWAYS internally included by Easy Code because it is necessary for all 32-bit Windows applications. If the project is a driver type, WINDOWS.INC is NEVER included as it would fire a lot of errors at compile time. Driver type projects only include their own inc files.
All procedures are global to the whole project (unless they are Private) so that you may invoke them from any other module without having to write a single word of code. If you want a procedure only "to be seen" inside the module it is placed, just make it private (Proc Private).
Optionally, variables can also be made global to the whole project (see Project properties) without having to write a single word of code.
Prototypes for all procedures in the project (protos), Public or Private, are written internally by Easy Code, so you do not have to worry about them.
When working with exe, dll and console projects, resources for your application can be made by the Resource Editor in a very easy way. The Resource Editor is not available for static libraries (lib projects) because they cannot have resources
You also can add one external compiled resource file (*.res) made outside Easy Code. If you do so, as only one resource file can be linked to the application, take into account the following considerations:
When saving a project for the first time, Easy Code creates a folder named Res inside the project directory. All image and any other file related to resources (and the external *.res file, if you add one) must be placed in the Res folder, so that Easy Code can find them when building the project. If not, errors will be generated and project will not be built.
If you want to use the Rich Edit or the Windows Common controls, mark the corresponding check box in the Project properties and the corresponding buttons will be shown in the tool box.
The Manifest.xml check box specifies whether the new comon controls, available from Windows XP and later, will be activated. For more information, please see the Including a Manifest in the project topic.
IMPORTANT: As only one resource file can be linked to an application, if you add an external compiled resource file (*.res), it is suposed to be the one that must be linked. Consequently, all existing resources in the Easy Code's Resource Editor (if any) will be ignored.
To avoid undesired errors, all files needed for building a project, including those necessary files for Windows applications (kernel32.inc, user32.inc, kernel32.lib, user32.lib, etc.), should be added to project through the Easy Code interface (better than including them in the code) using the following menus:
Include files (*.inc) Use Project-->Add Include files (*.inc;.h) menu Library files (*.lib) Use Project-->Add Library files (*.lib) menu Compiled resource file (*.res) Use Project-->Add external resources (*.res) menu Definition file (*.def) Use Project-->Add Definition file (*.def) menu
You do not need to write directives .model and option casemap in your code (if you do so, you will see a "WARNING" at compile time). The Easy Code interface always adds internally the following sentences (needed by 32-bit Windows applications):
You do not need to write the Align directive in your code because it is always written internally by Easy Code depending on what you specified in the Alignment item of the Project properties.
You do not need to write none of the .386, .486 or .586 directives as Easy Code always does it internally. The corresponding directive will be that specified in the Processor item of the Project properties.
Include and library files (*.inc and *.lib) are always searched in the following directories:
So, all Include or Library files needed must be added through the corresponding menu options, and must be in any of the specified directories. Any other files needed in the project must also be added to project and placed in the project directory (except image, extern *.res, and other resources related files, which must be in Res subdirectory).
When building Static Libraries (lib projects) and/or Dynamic Link Libraries (dll projects), it is possible to add a definition file (*.def). If so, just one definition file can be added to a project and it also must be in the project directory.
The final name of the executable, dynamic link library, static library, COFF object file or driver, is always the project name plus the corresponding extension (exe, dll, lib, obj or sys). That is, a project named Project1 will be Project1.exe, Project1.dll, Project1.lib, Project1.obj or Project1.sys, depending on the project type. If you are going to build a Classic NT driver (sys), please carefully read Building NT drivers.
When creating a new classic project, Easy Code automatically adds a module named Module1 with some intial code. You can add as many new or existing modules as you like, using the following menus:
In addition, the following files are always added by default (except for driver type projects):
Windows.inc is always included by default (except for driver type projects). If you wish to include the Macros.asm file, just check the corresponding option in the Project properties dialog box.
Simple applications do not need anything else. Anyway, if you use other API functions, i.e. from gdi32.dll, you will have to add the corresponding *.inc and *.lib files.
When adding existing modules, they should be made by Easy Code in order to work properly. Anyway, in many cases, assembler files (*.asm), not created by Easy Code, can be loaded succesfully.
When designing dialog boxes in the Resource Editor, you can place different controls inside them. For a list of available controls see Control objects.
To illustrate everything said here, have a good look to the examples coming with the Easy Code application (located in the Examples subdirectory of the Easy Code directory). The EasyCalc, GeneSys and RSEditor applications (classic projects) are made entirely with Easy Code and use all programming style we saw in this chapter.
REMARKS: In classic projects, you should write all the necessary code (just some initial code is written by Easy Code) and you are responsible for any directives (except those mentioned above), preserving registers Ebx, Edi and Esi (as required by Windows), etc., in order to compile and link without errors.
As Easy Code ignores the Option
procedures are always Public
by default if
they are not explicitily declared as Private.
Please see the Code and Data: Private