Fehlermeldungen bei "LRESULT" und "WINAPI"

Skini

Erfahrenes Mitglied
Hallo Leute,
ich habe folgendes Problem:
Wenn ich mein programm unter Dev-C++ (vista) kompiliere erscheinen immer folgende fehlermeldungen:
LRESULT does not name a type
WINAPI does not name a type
Unter Visual basic hab ich circa 25 Fehler meldungen die hier ausbleiben :confused:

Hier ist der Quellcode:
Code:
// jaw.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//
#include <windows>
	LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	MSG          msg;
	HWND         hWnd;
	WNDCLASS     wc; 
	char szAppName[] = "Jawbreaker";
   
	wc.cbClsExtra         = 0;
	wc.cbWndExtra         = 0;
	wc.hbrBackground      = (HBRUSH) GetStockObject(WHITE_BRUSH);
	wc.hCursor            = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon              = LoadIcon(NULL, IDI_APPLICATION);
	wc.hInstance          = hInstance;
	wc.lpfnWndProc        = WndProc;
	wc.lpszClassName      = szAppName;
	wc.lpszMenuName       = NULL;
	wc.style              = CS_HREDRAW | CS_VREDRAW;
   
	RegisterClass(&wc);
   
	hWnd = CreateWindow( szAppName, szAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,220, 240, NULL, NULL, hInstance, NULL);

	ShowWindow(hWnd, iCmdShow);

	bool Markb[132], Mende, Mhit, MF2;
	int colourb[132], c, c2, cw, ballcount = 132, Mposx, Mposy, Markcount, count;
	jpoint1:
	
	for(c = 1;c = 11;c++)
	{
	for(c2 = 1;c2 = 12; c2++)
		{
		cw = (c - 1) * 11
		markb[cw + c2] = False
		}
	}

	for(c = 1;c = 11;c++)
	{
	for(c2 = 1;c2 = 12; c2++)
		{
		cw = (c - 1) * 11
		colourb[cw + c2] = False
		}
	}
		
	srand (time(NULL))
	for(c = 1; c = 11; c++)
		{
		for(c2 = 1; c2 = 12; c2++)
			{
			cw = (c - 1) * 11
			colourb[cw + c2] = Rand() % 5 + 1;
			}
		}
	while(!Mende)
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				setpixel(hDC,c, c2, 255, 255, 255)
				}
			}
		Drawballs;
		Mposx = Mposx % 11 + 1;
		Mposy = Mposy % 12 + 1;
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				if(Mposx == c && Mposy == c2)
					{
					cw = (c - 1) * 11
					markb[cw + c2] = true;
					}
				}
			}
		if(Mhit)
			{
			Delete();
			Fall();
			}
			Deletemark();
			mark();

		if(MF2)
			{
			goto jpoint1;
			}
		if(!ballcount)
			{
			score;
			goto scored;
			}
			updatewindow;
	//messages
		if(GetMessage(&msg, NULL, 0, 0))
			{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
			}
		Mhit = false;
		Mposx = 0;
		Mposy = 0;
		scored:
		return msg.wParam;
}

	LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
		{
		switch (message)
   			{
			case WM_LBUTTONDOWN:
				{
				Mhit = true;
				return 0;
				}
			case WM_DESTROY:
				{
				Mende = True;
				PostQuitMessage(0);
				return 0;
				}
			case WM_MOUSEMOVE:
				{
				if(wParam & MK_MBUTTON)
					{
					hdc = GetDC(hwnd);
					Mposx = LOWORD(lParam);
					Mposy = HIWORD(lParam);
					}
				return 0;
				}
			case WM_KEYDOWN:
			{
				if ( GetKeyState(VK_F2) )
				{
					MF2 = true;
				}
				if ( GetKeyState(VK_F3) )
				{
					Mende = true;
				}
			}
				return 0;
			}
   		return DefWindowProc(hWnd, message, wParam, lParam);
		}
c, c2 und cw sind nur verschieden "counter" ;-),
die funktionen hab ich mal rausgenommen da ich die hier nicht für relevant Halte
und das sonst zu unübersichtlcih wär.
Wäre froh wenn mir jemand helfen würde, diese "Fehler" zu eliminieren :P
Skini
 
Hey, danke für deine schnelle antwort, jetz schluckt der kompiler das auch,
dafür erkennt er meine funktionen irgendwie nicht :eek:
ich kriege immer folgende fehlermeldungen:
'Mark' undeclared(first use this function)
oder auch:
expected primary-expression before 'void'
expected ';' before void
obwohl im letzten fall auf jeden ein ; vorhanden ist.
kann mir bitte jemand helfen
Code:
// jaw.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//
#include <windows.h>
#include <math.h>
	LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	MSG          msg;
	HWND         hWnd;
	WNDCLASS     wc; 
	char szAppName[] = "Jawbreaker";
   
	wc.cbClsExtra         = 0;
	wc.cbWndExtra         = 0;
	wc.hbrBackground      = (HBRUSH) GetStockObject(WHITE_BRUSH);
	wc.hCursor            = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon              = LoadIcon(NULL, IDI_APPLICATION);
	wc.hInstance          = hInstance;
	wc.lpfnWndProc        = WndProc;
	wc.lpszClassName      = szAppName;
	wc.lpszMenuName       = NULL;
	wc.style              = CS_HREDRAW | CS_VREDRAW;
   
	RegisterClass(&wc);
   
	hWnd = CreateWindow( szAppName, szAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,220, 240, NULL, NULL, hInstance, NULL);

	ShowWindow(hWnd, iCmdShow);

	bool Markb[132], Mende, Mhit, MF2;
	int colourb[132], c, c2, cw, ballcount = 132, Mposx, Mposy, Markcount, count, x, y, r ,g , b;
	jpoint1:
	
	for(c = 1;c = 11;c++)
	{
	for(c2 = 1;c2 = 12; c2++)
		{
		cw = (c - 1) * 11;
		Markb[cw + c2 - 1] = false;
		}
	}

	for(c = 1;c = 11;c++)
	{
	for(c2 = 1;c2 = 12; c2++)
		{
		cw = (c - 1) * 11;
		colourb[cw + c2 - 1] = false;
		}
	}
		
	srand (TIME(NULL));
	for(c = 1; c = 11; c++)
		{
		for(c2 = 1; c2 = 12; c2++)
			{
			cw = (c - 1) * 11;
			colourb[cw + c2 - 1] = Rand() % 5 + 1;
			}
		}
	while(!Mende)
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				setpixel(hDC,c, c2, 255, 255, 255);
				}
			}
		Drawballs;
		Mposx = Mposx % 11 + 1;
		Mposy = Mposy % 12 + 1;
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				if(Mposx == c && Mposy == c2)
					{
					cw = (c - 1) * 11;
					markb[cw + c2 - 1] = true;
					}
				}
			}
		if(Mhit)
			{
			Delete();
			Fall();
			}
			Deletemark();
			Mark();

		if(MF2)
			{
			goto jpoint1;
			}
		if(!ballcount)
			{
			score;
			goto scored;
			}
			updatewindow;
	//messages
		if(GetMessage(&msg, NULL, 0, 0))
			{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
			}
		Mhit = false;
		Mposx = 0;
		Mposy = 0;
		scored:
		return msg.wParam;
}

	LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
		{
		switch (message)
   			{
			case WM_LBUTTONDOWN:
				{
				Mhit = true;
				return 0;
				}
			case WM_DESTROY:
				{
				Mende = True;
				PostQuitMessage(0);
				return 0;
				}
			case WM_MOUSEMOVE:
				{
				if(wParam & MK_MBUTTON)
					{
					hdc = GetDC(hwnd);
					Mposx = LOWORD(lParam);
					Mposy = HIWORD(lParam);
					}
				return 0;
				}
			case WM_KEYDOWN:
			{
				if ( GetKeyState(VK_F2) )
				{
					MF2 = true;
				}
				if ( GetKeyState(VK_F3) )
				{
					Mende = true;
				}
			}
				return 0;
			}
   		return DefWindowProc(hWnd, message, wParam, lParam);
		}

	void Drawballs()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11;
				if(markb[cw + c2 - 1])
				{
				PAINTSTRUCT    ps;
				HDC            hDC;
				hDC = BeginPaint(hWnd, &ps);
				{
				Rectangle(hDC, c, c2, c + 20 , c2 + 20, 155, 155, 155);
				Rectangle(hDC, c + 1, c2 + 2, c + 19 , c2 + 19, 155, 155, 155);
				Rectangle(hDC, c + 2, c2 + 2, c + 18 , c2 + 18, 155, 155, 155);
				Rectangle(hDC, c + 3, c2 + 3, c + 17 , c2 + 17, 155, 155, 155);
				Rectangle(hDC, c + 4, c2 + 4, c + 16 , c2 + 16, 155, 155, 155);
				Rectangle(hDC, c + 5, c2 + 5, c + 15 , c2 + 15, 155, 155, 155);
				Rectangle(hDC, c + 6, c2 + 6, c + 14 , c2 + 14, 155, 155, 155);
				Rectangle(hDC, c + 7, c2 + 7, c + 13 , c2 + 13, 155, 155, 155);
				Rectangle(hDC, c + 8, c2 + 8, c + 12 , c2 + 12, 155, 155, 155);
				Rectangle(hDC, c + 9, c2 + 9, c + 11 , c2 + 11, 155, 155, 155);
				Rectangle(hDC, c + 10, c2 + 10, c + 10 , c2 + 10, 155, 155, 155);
					}
					EndPaint(hWnd, &ps);
					}
				cw = (c - 1) * 11
				if(colourb[cw + c2 - 1])
					{
						if(colourb[cw + c2 - 1] == 1)
						{
							paintcicel(c,c2,0,0,255);
						}
						if(colourb[cw + c2 - 1] == 2)
						{
							paintcicel(c,c2,0,255,0);
						}
						if(colourb[cw + c2 - 1] == 3)
						{
							paintcicel(c,c2,255,0,0);
						}
						if(colourb[cw + c2 - 1] == 4)
						{
							paintcicel(c,c2,255,255,0);
						}
						if(colourb[cw + c2 - 1] == 5)
						{
							paintcicel(c,c2,0,255,255);
						}
				}
			}
		}
		}
		
	void delete()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				if(markb[cw + c2 -1] && Mhit && markcount > 1)
					{
					colourb[cw + c2 - 1] = "";
					ballcount--;
					}
				}
			}
		}

	void Fall()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				if(colourb[cw + c2 - 1] && !colourb[cw + c2 + 1 - 1])
					{
					colourb[cw + c2 + 1 - 1] = colourb[cw + c2 - 1];
					markb[cw + c2 + 1 - 1] = markb[cw + c2 - 1];
					colourb[cw + c2 - 1] = "";
					markb[cw + c2 - 1] = false;
					}
				}
			}
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				if(colourb[cw + c2 - 1] && !colourb[cw + 11 + c2 - 1])
					{
					colourb[cw + 11 + c2 - 1] = colourb[cw + c2 - 1];
					markb[cw + 11 + c2 - 1] = markb[cw + c2 - 1];
					colourb[cw + c2 - 1] = "";
					markb[cw + c2 - 1] = false;
					}
				}
			}
		}
	void deletemark()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				markb[cw + c2 - 1] = false;
				}
			}
		markcount = 0
		}

	void Score()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				setpixel(hDC, c, c2, 255, 255, 255);
				sleep(1000);
				}
			}
		}
		
	void Paintcircel(x, y, r, g, b)
		{
		for(cw = 0; cw = 19; cw++)
			{
			for(cw2 = 0; cw2 = 19; cw2++)
			{
				PAINTSTRUCT    ps;
				HDC            hDC;
				hDC = BeginPaint(hWnd, &ps);
				{
            MoveToEx(hDC, x + 8, y);
            LineTo(hDC, x + 10, y, r, g, b);
            MoveToEx(hDC, x + 5, y + 1);
            LineTo(hDC, x + 14, y + 1, r, g, b);
            MoveToEx(hDC, x + 4, y + 2);
            LineTo(hDC, x + 15, y + 2, r, g, b);
            MoveToEx(hDC, x + 3, y + 3);
            LineTo(hDC, x + 16, y + 3, r, g, b);
            MoveToEx(hDC, x + 2, y + 4);
            LineTo(hDC, x + 17, y + 4, r, g, b);
            MoveToEx(hDC, x + 1, y + 5);
            LineTo(hDC, x + 18, y + 5, r, g, b);
            MoveToEx(hDC, x + 1, y + 6);
            LineTo(hDC, x + 18, y + 6, r, g, b);
            MoveToEx(hDC, x + 1, y + 7);
            LineTo(hDC, x + 18, y + 7, r, g, b);
            MoveToEx(hDC, x, y + 8);
            LineTo(hDC, x + 19, y + 8, r, g, b);
            MoveToEx(hDC, x, y + 9);
            LineTo(hDC, x + 19, y + 9, r, g, b);
            MoveToEx(hDC, x, y + 10);
            LineTo(hDC, x + 19, y + 10, r, g, b);
            MoveToEx(hDC, x, y + 11);
            LineTo(hDC, x + 19, y + 11, r, g, b);
            MoveToEx(hDC, x + 1, y + 12);
            LineTo(hDC, x + 18, y + 12, r, g, b);
            MoveToEx(hDC, x + 1, y + 13);
            LineTo(hDC, x + 18, y + 13, r, g, b);
            MoveToEx(hDC, x + 1, y + 14);
            LineTo(hDC, x + 18, y + 14, r, g, b);
            MoveToEx(hDC, x + 2, y + 15);
            LineTo(hDC, x + 17, y + 15, r, g, b);
            MoveToEx(hDC, x + 3, y + 16);
            LineTo(hDC, x + 16, y + 16, r, g, b);
            MoveToEx(hDC, x + 4, y + 17);
            LineTo(hDC, x + 15, y + 17, r, g, b);
            MoveToEx(hDC, x + 5, y + 18);
            LineTo(hDC, x + 14, y + 18, r, g, b);
            MoveToEx(hDC, x + 8, y + 19);
            LineTo(hDC, x + 10, y + 19, r, g, b);
				}
				EndPaint(hWnd, &ps);
			}
			}
		}
	void mark()
		{
		for(count = 1;count = 23; count++)
			{
				for(c = 1;c = 11; c++)
					{
					for(c2 = 1;c2 = 12)
						{
						cw = ((c -1) * 11) + c2);
						if(colourb[cw - 1])
							markb[cw - 1] = true;
							{
							if(colourb[cw + 1 - 1] == colourb[cw - 1])
								{
								markcount++;
								markb[cw + 1 - 1] = true;
								}
							if(colourb[cw - 1 - 1] == colourb[cw])
								{
								markcount++;
								markb[cw - 1 - 1] = true;
								}
							if(colourb[cw + 11 - 1] == colourb[cw])
								{
								markcount++;
								markb[cw + 11 - 1] = true;
								}
							if(colourb[cw - 11 - 1] == colourb[cw]
								{
								markcount++;
								markb[cw - 11 - 1] = true;
								}
							}
						}
					}
			}
		}
}

dass mit c, c2 und cw ist geblieben :P
MfG Skini
 
Alle Funktionen müssen deklariert werden, so wie du es bei der "WndProc" gemacht hast. Variablen, die in der "WinMain" erstellt wurden sind in den Funktionen nicht sichtbar. Entweder du deklarierst sie global (also außerhalb von WinMain) oder übergibst sie als Parameter an die betreffenden Funktionen.

Gruß
MCoder
 
Du verwechselst das vermutlich mit der Implementierung
C++:
void Drawballs(); // Deklaration

void Drawballs()  // Implementierung
{
    // ... irgendwelcher Code
}
Die Deklaration macht die Funktion bekannt und sollte vor der ersten Verwendung, also in deinem Fall vor WinMain, erfolgen.

Gruß
MCoder
 
*Rotanlauf* danke
eien letzte:
könntest du den code vieleicht mal durch den kompilerjagen, ich hab da so ominöse fehler meldungen wo nach ; verlangt wird ob wohl es nit gebraucht wird oder da ist?
*ganzliebguck*
das hier ist dann wohl der deklarierte code:
C++:
// jaw.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//
#include <windows.h>
#include <math.h>
using namespace std;
	LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
    void Drawballs();
    void Deletemark();
    void Delete();
    void Mark();
    void Score();
	bool Markb[132], Mende, Mhit, MF2;
	int colourb[132], c, c2, cw, ballcount = 132, Mposx, Mposy, Markcount, count, x, y, r ,g , b;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	MSG          msg;
	HWND         hWnd;
	WNDCLASS     wc; 
	char szAppName[] = "Jawbreaker";
   
	wc.cbClsExtra         = 0;
	wc.cbWndExtra         = 0;
	wc.hbrBackground      = (HBRUSH) GetStockObject(WHITE_BRUSH);
	wc.hCursor            = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon              = LoadIcon(NULL, IDI_APPLICATION);
	wc.hInstance          = hInstance;
	wc.lpfnWndProc        = WndProc;
	wc.lpszClassName      = szAppName;
	wc.lpszMenuName       = NULL;
	wc.style              = CS_HREDRAW | CS_VREDRAW;
   
	RegisterClass(&wc);
   
	hWnd = CreateWindow( szAppName, szAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,220, 240, NULL, NULL, hInstance, NULL);

	ShowWindow(hWnd, iCmdShow);


	jpoint1:
	
	for(c = 1;c = 11;c++)
	{
	for(c2 = 1;c2 = 12; c2++)
		{
		cw = (c - 1) * 11;
		Markb[cw + c2 - 1] = false;
		}
	}

	for(c = 1;c = 11;c++)
	{
	for(c2 = 1;c2 = 12; c2++)
		{
		cw = (c - 1) * 11;
		colourb[cw + c2 - 1] = false;
		}
	}
		
	srand (TIME(NULL));
	for(c = 1; c = 11; c++)
		{
		for(c2 = 1; c2 = 12; c2++)
			{
			cw = (c - 1) * 11;
			colourb[cw + c2 - 1] = Rand() % 5 + 1;
			}
		}
	while(!Mende)
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				setpixel(hDC,c, c2, 255, 255, 255);
				}
			}
		Drawballs;
		Mposx = Mposx % 11 + 1;
		Mposy = Mposy % 12 + 1;
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				if(Mposx == c && Mposy == c2)
					{
					cw = (c - 1) * 11;
					markb[cw + c2 - 1] = true;
					}
				}
			}
		if(Mhit)
			{
			Delete();
			Fall();
			}
			Deletemark();
			Mark();

		if(MF2)
			{
			goto jpoint1;
			}
		if(!ballcount)
			{
			score;
			goto scored;
			}
			updatewindow;
	//messages
		if(GetMessage(&msg, NULL, 0, 0))
			{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
			}
		Mhit = false;
		Mposx = 0;
		Mposy = 0;
		scored:
		return msg.wParam;
}

	LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
		{
		switch (message)
   			{
			case WM_LBUTTONDOWN:
				{
				Mhit = true;
				return 0;
				}
			case WM_DESTROY:
				{
				Mende = True;
				PostQuitMessage(0);
				return 0;
				}
			case WM_MOUSEMOVE:
				{
				if(wParam & MK_MBUTTON)
					{
					hdc = GetDC(hwnd);
					Mposx = LOWORD(lParam);
					Mposy = HIWORD(lParam);
					}
				return 0;
				}
			case WM_KEYDOWN:
			{
				if ( GetKeyState(VK_F2) )
				{
					MF2 = true;
				}
				if ( GetKeyState(VK_F3) )
				{
					Mende = true;
				}
			}
				return 0;
			}
   		return DefWindowProc(hWnd, message, wParam, lParam);
		}

	void Drawballs()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11;
				if(markb[cw + c2 - 1])
				{
				PAINTSTRUCT    ps;
				HDC            hDC;
				hDC = BeginPaint(hWnd, &ps);
				{
				Rectangle(hDC, c, c2, c + 20 , c2 + 20, 155, 155, 155);
				Rectangle(hDC, c + 1, c2 + 2, c + 19 , c2 + 19, 155, 155, 155);
				Rectangle(hDC, c + 2, c2 + 2, c + 18 , c2 + 18, 155, 155, 155);
				Rectangle(hDC, c + 3, c2 + 3, c + 17 , c2 + 17, 155, 155, 155);
				Rectangle(hDC, c + 4, c2 + 4, c + 16 , c2 + 16, 155, 155, 155);
				Rectangle(hDC, c + 5, c2 + 5, c + 15 , c2 + 15, 155, 155, 155);
				Rectangle(hDC, c + 6, c2 + 6, c + 14 , c2 + 14, 155, 155, 155);
				Rectangle(hDC, c + 7, c2 + 7, c + 13 , c2 + 13, 155, 155, 155);
				Rectangle(hDC, c + 8, c2 + 8, c + 12 , c2 + 12, 155, 155, 155);
				Rectangle(hDC, c + 9, c2 + 9, c + 11 , c2 + 11, 155, 155, 155);
				Rectangle(hDC, c + 10, c2 + 10, c + 10 , c2 + 10, 155, 155, 155);
					}
					EndPaint(hWnd, &ps);
					}
				cw = (c - 1) * 11
				if(colourb[cw + c2 - 1])
					{
						if(colourb[cw + c2 - 1] == 1)
						{
							paintcicel(c,c2,0,0,255);
						}
						if(colourb[cw + c2 - 1] == 2)
						{
							paintcicel(c,c2,0,255,0);
						}
						if(colourb[cw + c2 - 1] == 3)
						{
							paintcicel(c,c2,255,0,0);
						}
						if(colourb[cw + c2 - 1] == 4)
						{
							paintcicel(c,c2,255,255,0);
						}
						if(colourb[cw + c2 - 1] == 5)
						{
							paintcicel(c,c2,0,255,255);
						}
				}
			}
		}
		}
		
	void delete()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				if(markb[cw + c2 -1] && Mhit && markcount > 1)
					{
					colourb[cw + c2 - 1] = "";
					ballcount--;
					}
				}
			}
		}

	void Fall()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				if(colourb[cw + c2 - 1] && !colourb[cw + c2 + 1 - 1])
					{
					colourb[cw + c2 + 1 - 1] = colourb[cw + c2 - 1];
					markb[cw + c2 + 1 - 1] = markb[cw + c2 - 1];
					colourb[cw + c2 - 1] = "";
					markb[cw + c2 - 1] = false;
					}
				}
			}
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				if(colourb[cw + c2 - 1] && !colourb[cw + 11 + c2 - 1])
					{
					colourb[cw + 11 + c2 - 1] = colourb[cw + c2 - 1];
					markb[cw + 11 + c2 - 1] = markb[cw + c2 - 1];
					colourb[cw + c2 - 1] = "";
					markb[cw + c2 - 1] = false;
					}
				}
			}
		}
	void deletemark()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				cw = (c - 1) * 11
				markb[cw + c2 - 1] = false;
				}
			}
		markcount = 0
		}

	void Score()
		{
		for(c = 1; c = 11; c++)
			{
			for(c2 = 1; c2 = 12; c2++)
				{
				setpixel(hDC, c, c2, 255, 255, 255);
				sleep(1000);
				}
			}
		}
		
	void Paintcircel(x, y, r, g, b)
		{
		for(cw = 0; cw = 19; cw++)
			{
			for(cw2 = 0; cw2 = 19; cw2++)
			{
				PAINTSTRUCT    ps;
				HDC            hDC;
				hDC = BeginPaint(hWnd, &ps);
				{
            MoveToEx(hDC, x + 8, y);
            LineTo(hDC, x + 10, y, r, g, b);
            MoveToEx(hDC, x + 5, y + 1);
            LineTo(hDC, x + 14, y + 1, r, g, b);
            MoveToEx(hDC, x + 4, y + 2);
            LineTo(hDC, x + 15, y + 2, r, g, b);
            MoveToEx(hDC, x + 3, y + 3);
            LineTo(hDC, x + 16, y + 3, r, g, b);
            MoveToEx(hDC, x + 2, y + 4);
            LineTo(hDC, x + 17, y + 4, r, g, b);
            MoveToEx(hDC, x + 1, y + 5);
            LineTo(hDC, x + 18, y + 5, r, g, b);
            MoveToEx(hDC, x + 1, y + 6);
            LineTo(hDC, x + 18, y + 6, r, g, b);
            MoveToEx(hDC, x + 1, y + 7);
            LineTo(hDC, x + 18, y + 7, r, g, b);
            MoveToEx(hDC, x, y + 8);
            LineTo(hDC, x + 19, y + 8, r, g, b);
            MoveToEx(hDC, x, y + 9);
            LineTo(hDC, x + 19, y + 9, r, g, b);
            MoveToEx(hDC, x, y + 10);
            LineTo(hDC, x + 19, y + 10, r, g, b);
            MoveToEx(hDC, x, y + 11);
            LineTo(hDC, x + 19, y + 11, r, g, b);
            MoveToEx(hDC, x + 1, y + 12);
            LineTo(hDC, x + 18, y + 12, r, g, b);
            MoveToEx(hDC, x + 1, y + 13);
            LineTo(hDC, x + 18, y + 13, r, g, b);
            MoveToEx(hDC, x + 1, y + 14);
            LineTo(hDC, x + 18, y + 14, r, g, b);
            MoveToEx(hDC, x + 2, y + 15);
            LineTo(hDC, x + 17, y + 15, r, g, b);
            MoveToEx(hDC, x + 3, y + 16);
            LineTo(hDC, x + 16, y + 16, r, g, b);
            MoveToEx(hDC, x + 4, y + 17);
            LineTo(hDC, x + 15, y + 17, r, g, b);
            MoveToEx(hDC, x + 5, y + 18);
            LineTo(hDC, x + 14, y + 18, r, g, b);
            MoveToEx(hDC, x + 8, y + 19);
            LineTo(hDC, x + 10, y + 19, r, g, b);
				}
				EndPaint(hWnd, &ps);
			}
			}
		}
	void mark();
		{
		for(count = 1;count = 23; count++)
			{
				for(c = 1;c = 11; c++)
					{
					for(c2 = 1;c2 = 12)
						{
						cw = ((c -1) * 11) + c2);
						if(colourb[cw - 1])
							markb[cw - 1] = true;
							{
							if(colourb[cw + 1 - 1] == colourb[cw - 1])
								{
								markcount++;
								markb[cw + 1 - 1] = true;
								}
							if(colourb[cw - 1 - 1] == colourb[cw])
								{
								markcount++;
								markb[cw - 1 - 1] = true;
								}
							if(colourb[cw + 11 - 1] == colourb[cw])
								{
								markcount++;
								markb[cw + 11 - 1] = true;
								}
							if(colourb[cw - 11 - 1] == colourb[cw]
								{
								markcount++;
								markb[cw - 11 - 1] = true;
								}
							}
						}
					}
			}
		}
    }
 
Zuletzt bearbeitet:
Was bei dir absolut nicht passt, ist die Verwendung der Variablen.

Variablen, die du innerhalb von WinMain deklarierst sind nur dort gültig und nicht in den Funktionen. Die Schleifenvariablen und solche, die du nur innerhalb einer Funktion benötigst, solltest du auch in jeder Funktion separat deklarieren. Variablen, die in der z.B. WinMain belegt werden und in einer von dort aufgerufenen Funktion benötigt werden, musst du als Parameter übergeben.

Gruß
MCoder
 
Zurück