I've just translated a project from Basic to C.
In the process I've lost access to the "CurrentScreen" variable. I've fixed it for now using an "extern", but I think this variable should be "exported" by default.
Need to access CurrentScreen
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: Need to access CurrentScreen
Hi Oliver,
Could you please provide us with more details about this issue?
Where have you defined the CurrentScreen structure? It should be defined in driver.c file.
Kind regards,
Could you please provide us with more details about this issue?
Where have you defined the CurrentScreen structure? It should be defined in driver.c file.
Kind regards,
Stefan Filipović
Re: Need to access CurrentScreen
That's the point, in a mikrobasic project it is in the "interface" part of driver.mbas, so it is available.It should be defined in driver.c file.
In a mikroC project it is in the "c" file, so effectively it is private to that file unless exported by a header.
The exports appear to be in <project>_objects.h
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: Need to access CurrentScreen
Hi Oliver,
There is an objects.h file in the mikroC VTFT project. There you can declare this object with an extern specifier to be able to use it in other source files.
Kind regards,
There is an objects.h file in the mikroC VTFT project. There you can declare this object with an extern specifier to be able to use it in other source files.
Code: Select all
extern TScreen* CurrentScreen;
Stefan Filipović