Hi
This is the part of my code...
.... Code.....
...
...
#ifdef SIMWIN
using System.Windows.Forms;
#endif
void screeninfo(void)
{
int num_screens;
int i = 0;
int j = 0;
int cord=0;
int width,height;
char pstr[10];
Symbol *s;
#ifdef DEBUG
printf ("screeninfo\n");
#endif
#ifndef SIMWIN
...........Code for Unix
#else
int upperBound;
Screen [] screens = Screen.AllScreens;
upperBound = screens.GetUpperBound(0);
s = (Symbol *) emalloc(sizeof(Symbol));
s->type = ARRAY;
SetArrayClass(s);
s->memory_size = 1;
s->u.sym = (Symbol **)ecalloc(1, sizeof(Symbol *));
j = num_screens;
#endif
s->num_elements =j;
PushSymbol(s);
}
and I am getting this error now:
c:\harshwork\com\src\simmacro\code.c(9572): error C2059: syntax error :
'.'
c:\harshwork\com\src\simmacro\code.c(9572): error C2143: syntax error :
missing ';' before '.'
c:\harshwork\com\src\simmacro\code.c(9572): error C2873: 'System' :
symbol cannot be used in a using-declaration
c:\harshwork\com\src\simmacro\code.c(9641): error C2059: syntax error :
']'
c:\harshwork\com\src\simmacro\code.c(9641): error C2065: 'Screen' :
undeclared identifier
c:\harshwork\com\src\simmacro\code.c(9642): error C2065: 'screens' :
undeclared identifier
c:\harshwork\com\src\simmacro\code.c(9642): error C2228: left of
'.GetUpperBound' must have class/struct/union type
type is ''unknown-type''
am i doing something wrong?
Jakob said:
Did you create a reference to System.Windows.Forms and put a using
statement
at the top:
using System.Windows.Forms;
HTH, Jakob.
--
http://www.dotninjas.dk
jainharsh said:
Hi Guyz,
I am trying to get the number of screens and its resolution in windows.
When I do this...
Screen [] screens = Screen.AllScreens;
upperBound = screens.GetUpperBound(0);
I get this error:
error C2059: syntax error : ']'
error C2065: 'Screen' : undeclared identifier
error C2065: 'screens' : undeclared identifier
error C2228: left of '.GetUpperBound' must have class/struct/union type
Any help would be appreciated...
Thanks,
Harsh