No such file or directory.



  • huhu

    also ich hab folgendes Problem

    #include <windows.h>
    #include "recource.h"
    
    HINSTANCE hInst;
    LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
    
    INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                       LPSTR lpCmdLine, int nCmdShow)
    {
        WNDCLASSEX  WndCls;
        static char szAppName[] = "BitmapIntro";
        MSG         Msg;
    
    	hInst       = hInstance;
        WndCls.cbSize        = sizeof(WndCls);
        WndCls.style         = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;
        WndCls.lpfnWndProc   = WindProcedure;
        WndCls.cbClsExtra    = 0;
        WndCls.cbWndExtra    = 0;
        WndCls.hInstance     = hInst;
        WndCls.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
        WndCls.hCursor       = LoadCursor(NULL, IDC_ARROW);
        WndCls.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
        WndCls.lpszMenuName  = NULL;
        WndCls.lpszClassName = szAppName;
        WndCls.hIconSm       = LoadIcon(hInstance, IDI_APPLICATION);
        RegisterClassEx(&WndCls);
    
        CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,
                              szAppName,
                              "Bitmaps Fundamentals",
                              WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              NULL,
                              NULL,
                              hInstance,
                              NULL);
    
        while( GetMessage(&Msg, NULL, 0, 0) )
        {
            TranslateMessage(&Msg);
            DispatchMessage( &Msg);
        }
    
        return static_cast<int>(Msg.wParam);
    }
    
    LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg,
    			   WPARAM wParam, LPARAM lParam)
    {
        HDC hDC, MemDCExercising;
        PAINTSTRUCT Ps;
        HBITMAP bmpExercising;
    
        switch(Msg)
        {
    	case WM_DESTROY:
    	    PostQuitMessage(WM_QUIT);
    	    break;
    	case WM_PAINT:
    	    hDC = BeginPaint(hWnd, &Ps);
    
    	    // Load the bitmap from the resource
    	    bmpExercising = LoadBitmap(hInst, MAKEINTRESOURCE(1000));
    	    // Create a memory device compatible with the above DC variable
    	    MemDCExercising = CreateCompatibleDC(hDC);
                 // Select the new bitmap
                 SelectObject(MemDCExercising, bmpExercising);
    
    	    // Copy the bits from the memory DC into the current dc
    	    BitBlt(hDC, 10, 10, 450, 400, MemDCExercising, 0, 0, SRCCOPY);
    
    	    // Restore the old bitmap
    	    DeleteDC(MemDCExercising);
    	    DeleteObject(bmpExercising);
    	    EndPaint(hWnd, &Ps);
    	    break;
    	default:
    	    return DefWindowProc(hWnd, Msg, wParam, lParam);
        }
        return 0;
    }
    

    .h

    #define ID_BITMAP1 1000
    

    .rc

    #include <windows.h>
    #include "Resource.h"
    
    ID_BITMAP1 BITMAP "exercise.bmp"
    

    sobald ich diesen Code compilieren will kommt folgender Fehler

    4 C:\Dokumente und Einstellungen\HoPPeL\Desktop\test_private.rc In file included from test_private.rc

    2 C:\Dev-Cpp\Templates\Recource.rc Resource.h: No such file or directory.

    bloß jetzt ist die frage, die ich mir schon ne weile stelle, woran liegt es??
    thx schon mal die lösung ist bestimmt ganz einfach und ich schäm mich jetzt schon 😞

    mfg



  • Wie mir scheint, liegen deine Dateien nicht im gleichen Verzeichniss, deswegen kann Resource.h nicht eingebunden werden. Mich verwirren auch die 2 verschiedenen Fehlermeldungen. Benutzt du etwa 2 mal eine *.rc Datei?
    Probier mal die *.rc und dazugehörigen *.h Dateien in ein Verzeichniss zu legen.



  • hmm ich hab jetzt noch mal alle files in einen extra ordern gepackt...
    in diesem befinden sich jetzt

    exercise.bmp
    Exercise.cpp
    Resource.rc
    Resource.h
    test.dev

    aber der Fehler bleibt der gleiche 😞

    mfg



  • wer ne idde??

    mfg


Anmelden zum Antworten