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 easier, and for that reason you should
take into account some considerations in
order to avoid errors:
You SHOULD ALWAYS include Windows.inc (or Windows.h if you are using the GoAsm headers) in order to be able to use Windows constants and refer to API functions in an easier way. If this file is not included, you will have to write the constants value and taking into account what API function you are calling to (i.e: GetModuleHandleA or GetModuleHandleW). The code generated by Easy Code when creating a project (except driver type projects) always include this file. Driver projects should NEVER include Windows.inc (nor Windows.h), as they already include their own .h files.
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 classic COFF object (obj projects) as they cannot have resources
You can also 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 files 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 the 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, 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 (Windows.inc, kernel32.dll, user32.dll, 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 Dynamic link files (*.dll;*.ocx;*.drv;*.exe) Use Project-->Add files to link menu Compiled resource file (*.res) Use Project-->Add external resources (*.res) menu
You do not need to write the Align
directive
in your code as it is always
written internally by Easy Code. The value for aligning code and data
will be that
specified in the Alignment
(code and data)
item of the Project
properties.
Include files (*.inc;*.h) are always searched in the following directories:
Dynamic link lfiles (*.dll;*.ocx;*.drv;*.exe)
are searched in the System
directory. The GoLink linker ignores .lib
files and takes all needed information from the System dll's (see
also Using
the #DynamicLinkFile directive).
So, all Include or dll 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).
The final name of the executable, dynamic link library, COFF object file or driver, is always the project name plus the corresponding extension (exe, dll, obj or sys). That is, a project named Project1 will be Project1.exe, Project1.dll, 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:
Windows.inc (or Windows.h
if you are using the
GoAsm
headers) is always included
by default except
for driver type projects.
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 CardFile application (classic project) and the default Classic executable file (coded by Jeremy Gordon) are entirely made 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.