String was not declared in this scope

Hallo,

diese Meldung kommt immer, wenn ich mein Programm kompillieren möchte. Aber ich habe die string.h eingebunden:
Code:
#include <windows.h>
#include <string>
#include "menu.h"

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
//Deklaration der Windows-Nachrichten-Prozedur

HWND hwnd;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrI, PSTR szCmdLine, int nCmdShow)
{
    const char g_szClassName[] = "Fensterklasse";
    WNDCLASSEX wc;

    wc.cbSize = sizeof(WNDCLASSEX);
    wc.style = 0;
    wc.lpfnWndProc = WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hInstance;
    wc.hIcon = 0;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
    wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
    wc.lpszClassName = g_szClassName;
    wc.hIconSm = NULL;

    if(!RegisterClassEx(&wc))
    {
        MessageBox(NULL,"Fenster konnte nicht erstellt werden.","Fehler",MB_ICONERROR|MB_OK);
        return 0;
    }

    hwnd = CreateWindowEx(0, g_szClassName, "Api", WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN,
                          CW_USEDEFAULT,CW_USEDEFAULT, 480, 360, NULL, NULL, hInstance, NULL);
    if(hwnd == NULL)
    {
        MessageBox( NULL, "Konnte kein Fenster erstellen!",
                      "Error!",MB_ICONEXCLAMATION | MB_OK  );
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

// Nachrichten-Schleife
    MSG msg;
        while (GetMessage (&msg, NULL, 0, 0)>0)
        {
            TranslateMessage (&msg);
            DispatchMessage (&msg);
        }
    return msg.wParam;
}

// Windows-Nachrichten-Prozedur
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
char filename[128];
char zeile[500];
HWND hwndButton;
string file;

switch (message)
{
    case WM_CREATE:
        hwndButton = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON","Öffnen",WS_CHILD|WS_VISIBLE,50,5,50,20,hwnd,(HMENU)ID_BUTTON,GetModuleHandle(NULL),NULL);
    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
            case ID_EXIT:
                DestroyWindow(hwnd);
                break;
        }
        return 0;
    case WM_CLOSE:
        DestroyWindow(hwnd);
    case WM_DESTROY:
        PostQuitMessage (0);
        return 0;
    }
    return DefWindowProc (hwnd, message, wParam, lParam);
}
 
Zurück
Oben