Re: AllScreen

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



What language is this??
Is this Managed C++ 1.0? (as opposed to ManagedC++ 2.0) I don't know it's
syntax well, so I could only guess.
But I would bet that

"using System.Windows.Forms;" is wrong, it should (probably be) "using
namespace System::Windows::Forms;"
" Screen [] screens = Screen.AllScreens;" is wrong, it should probably be "
array<Screen*>* screens = Screen::AllScreens;"
etc...
you should read the Managed C++ 1.0 documentation to learn the proper syntax
or ask the managed C++ group (there are probably some peoply who used the
old syntax and might answer your questions)

"jainharsh" <jain.personal@xxxxxxxxx> wrote in message
news:1166120911.283127.172090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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 Christensen wrote:
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" wrote:

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





.



Relevant Pages

  • Array Problems
    ... I'm currently trying to write a program with an array ... but for the life of me I can't seem to get the right syntax for the ... fail.cpp:21: (Each undeclared identifier is reported only once ...
    (comp.lang.c)
  • failed build for tk-8.4.5,1 and bittorrent
    ... error: syntax error before "ClientData" ... error: syntax error before "VOID" ... syntax er ror before "int" ... error: ...
    (freebsd-questions)
  • Defining an alias
    ... int __declspecSomeNewName ... The second declaration is the body of the function. ... All this syntax is quite horrible. ... The alias attribute causes the declaration to be emitted as an alias for another symbol, ...
    (comp.lang.c)
  • Re: C++ compile error
    ... hello.C: In function `int main': hello.C:5: error: `cout' undeclared hello.C:5: error: (Each undeclared identifier is reported only once for each function it appears in.) ... cout is part of the 'std' namespace, ... I'm totally puzzled by this complex language when I compile my first program. ...
    (freebsd-questions)
  • Re: [RFC] bloody mess with __attribute__() syntax
    ... In any case, since they prohibit auto int z, they'd ... space qualifier according to that syntax. ... for inclusion in GCC, we're planning to make the implementation ... So we either need gcc typeofto remove address space qualifier ...
    (Linux-Kernel)