Hello again :-)
Here I am with another stupid question.
I'm trying to make a class for a Log system. And I only just tried something with classes, and my first succesfull attempt was the following:
Code:
static void Click( int x, int y ) {
SetCursorPos( x, y );
mouse_event( MOUSEEVENTF_LEFTDOWN, 0,0,0,0 );
mouse_event( MOUSEEVENTF_LEFTUP, 0,0,0,0);
}
which could be called with:
Click( 100,100 );
That code worked, so I wanted to move on. So I wanted to do the following:
Code:
static void Log( String^ Message ) {
this->listBox1->Items->Add( Message );
}
But surprisingly that didn't work. ( Actually, after "this->" nothing appeared or anything..
When I compile that, I get the following errors:
(49) : error C2671: 'Klassetest::Form1::Log' : static member functions do not have 'this' pointers
(49) : error C2227: left of '->listBox1' must point to class/struct/union/generic type
(49) : error C2227: left of '->Items' must point to class/struct/union/generic type
(49) : error C2227: left of '->Add' must point to class/struct/union/generic type
So, how do I make that work in Visual C++ ? :-)