Need to access CurrentScreen

General discussion on Visual GLCD Software.
Post Reply
Author
Message
oliverb
Posts: 570
Joined: 24 May 2007 15:09

Need to access CurrentScreen

#1 Post by oliverb » 13 Nov 2019 12:26

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.

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: Need to access CurrentScreen

#2 Post by stefan.filipovic » 15 Nov 2019 10:14

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,
Stefan Filipović

oliverb
Posts: 570
Joined: 24 May 2007 15:09

Re: Need to access CurrentScreen

#3 Post by oliverb » 15 Nov 2019 10:58

It should be defined in driver.c file.
That's the point, in a mikrobasic project it is in the "interface" part of driver.mbas, so it is available.
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

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: Need to access CurrentScreen

#4 Post by stefan.filipovic » 15 Nov 2019 11:43

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.

Code: Select all

extern TScreen* CurrentScreen;
Kind regards,
Stefan Filipović

Post Reply

Return to “Visual GLCD General”