(If you have a new question - send it to us. As soon we get the same question the second time we will include it here ;-). Please also see our buzzword list - maybe you will find the answer there.
See also the Display Machine (DM) FAQ!
How can I
|
How the system
I have a problem:
Why
|
are explained in ....\EXAMPLES\WINLIBS\MULTI.DLL - have a look at this example in your Visual Eiffel installation - and also here.
First, finalize your program. This will enable the compiler to put a lot of optimizations in - especially if you use ARRAYs. We will provide in the near future a profiling option for Visual Eiffel. This will help you to optimize in the right places. Then, make sure that you compiled everything to native code - not to p-code. Finally, use the profiler and the tuner tool we provide. In extreme cases it can be useful to rewrite the most time critical parts using another, specialized language (for example Fortran for numeric applications)
Keep in mind that in Eiffel there is usually a trade off between storage used and speed - if you have not much ram, your application will run slower. Paging will slow down any applications. So, use the appropriate Windows tools to find out about the paging activities. Our tuner application will help you in fine tuning your Visual Eiffel application for maximum speed.
(Applies also to other languages) First it is important to know that Visual Eiffel and the Visual Eiffel linker use the COFF format. So additional object modules must be available in this format. If your C compiler cannot produce COFF object files, you should probably use a third party linker which can link both formats together. As in this case you must link you programs "manually", be aware that the proper linker commands (for the Visual Eiffel linker and MS link) are stored in a .rsp file in the EPROJECT subdirectory of your project. The parameter passing conventions between Eiffel and other languages are described in a special chapter
There are several ways to do this. First, you can use the DLL form of the runtime. This option can be set in the .esd file or by setting the proper toggle in the project option area of the workbench. Next we suggest to use the finalize option or the finalize command in the workbench.
In some special situations it may make sense to break down your application into some small DLLs. We have done this with Visual Eiffel itself. The compiler itself (about 200,000 source lines) is a DLL of about 3 MB RAM.
In order to perform this task we provide a collection of useful examples in the Visual Eiffel delivery. Please look into the examples/misc/ve_api subdirectory.
The expanded types are implemented in Visual Eiffel as one would expect: The objects contain no additional information (like a header) and can be used exactly instead of a C structure. The following Eiffel class:
expanded class EXP_TST feature {NONE} i : INTEGER; j : INTEGER; k : INTEGER; end
is equivalent to the C structure
typedef struct _EIFFEL_EXPANDED { int i; int j; int k; } EIFFEL_EXPANDED;
So it is possible to call an external C routine using a parameter of type EXP_TST. This parameter has the type EIFFEL_EXPANDED on the C side. (there is a complete example available in .. examples\expanded\example1
In this way API parameter blocks can be built in Eiffel without the need to have an additional C layer in between. You can call all Windows API directly from Eiffel - and you can set all parameter blocks in corresponding expanded Eiffel classes. As an (rather big) example we provide the WINLIBS library as part of the Visual Eiffel setup.
This should never be necessary ;-) - only if you sell your computer, but even then it is enough to delete the activation key ve.key from the bin directory.
If you really want to uninstall Visual Eiffel, do it the official way: select add/remove programs in the control panel and select Visual Eiffel. Windows will do the rest for you.
You will see sooner or later that there are to many projects in the repository. This is not bad per se, but it becomes more and more difficult to handle a extremely big repository. In addition the compiler creates a database for each project and each library. This database is not as big as one may expect - typical sizes are between 0.5 Mbytes for a small and 5 Mbytes for a medium sized project.
Visual Eiffel gives you three opportunities. You can release the complete storage used by the project, compress it (using the export facility) and you can unmount a project - keeping all information but dismount it from the repository...
First you should be sure that the project has been successfully compiled.
![]() |
the debugger is activated by pushing the Go button in the speed bar. If this does not work, check the compiler options. It is necessary to set the toggle to include the debugger information. | ![]() |
The reason is rather simple: it is possible to manipulate the .esd file manually with an editor. But the workbench can also set different options. So we must decide who is right - and whose options are correct.
As this decision will be always wrong, we decided that the workbench will always create a file with the name project.esd and use this file - for compilation and in order to save the options you entered into the workbench dialogs. The first project.esd file will be created based on the esd file you selected when you opened the project for the first time from the workbench.
We suggest that you subscribe the Visual Eiffel mailing list.
We have a special compiler option /fp (for parse path) for this purpose. Go to the folder where you want to create your library and parse all Eiffel classes you want to include into your library. Lets assume the folders are c:\my_lib\folder_1, c:\my_lib\folder_2 and m:\your_lib\folder. The library is to be created in d:\newlib - and there is already a pfd file lib.pdf.
So, go to d:\newlib and issue the following commands:
vec /pf:c:\my_lib\folder_1 /pf:c:\my_lib\folder_2 /pf:m:\your_lib\folder vec /p:lib.pdf
Is there any way to read INTEGERs, REALs, etc from a given memory address?
Use 'mem_copy' from class MEMORY (kernel cluster), or if your structures are 4 bytes long you can alternatively use 'ptrval_to_int' from class MACRO (WinLib cluster). For example, to read a value from a memory address into an INTEGER, use:
i: INTEGER address: INTEGER p: POINTER ... address := ... p.from_integer (address) i := macro.ptrval_to_int (p)
You can replace the last line by this one:
mem_copy ($i, p, 4)
This generates a compiler warning (because Eiffel is very strict about where the address operator "$" may be used) but Visual Eiffel allows it to be used more freely. You have to use the second form if you want to read other than 4 bytes (e.g. one character at a time).
You can freely convert between INTEGER, POINTER and BIT 32 in Visual Eiffel.
Is there any way to read/write data from/to a binary file?
The following approaches can be used:
expanded class BAR feature length: DOUBLE; color: CHARACTER; end -- class BARcan be used to access a file containing 5-bytes long fixed records.
I've got a fixed sized structure that I would like to send to a device. The structure represents a device command, and the only point of commonality between the commands is the structure's size. What might be an integer value in one case is a bit field in another. Is there a class which would offer me such low level control over this structure?
No problem. Define your structure as an expanded class. Where your structure maps to Eiffel types (e.g. if you have a 4-byte INTEGER), use the Eiffel types. In other cases, use BIT 8, BIT 16 or BIT 32. You can copy bits to and from Eiffel attributes (INTEGER, CHARACTER etc), then use the shift and rotation operators of the BIT class to put them into the right part of your structure. Finally, use 'mem_copy' to copy the entire contents of the structure to and from your device (or simply pass a pointer to your structure to your device driver - see class WAPI_POINT in cluster WIN_LIB for an example of how to add a feature 'ptr' that returns a pointer to the start of your structure.
Please follow this step by step description:
class MAIN creation make feature make is do print("My new program...press a key to exit!") io.read_character end end