Hilfe Improved Console



  • habe mir Heute Improved Console runtergeladen und es wie auf der Homepage vom Sidewinder in meine Entwicklunsumgebung eingebunden jedoch bringt mir der Compiler folgende Fehlermeledung ->

    "StdAfx.cpp
    Kompilierung läuft...
    Demo.cpp
    c:\improved console\demo\demo.cpp(105) : fatal error C1010: Unerwartetes Dateiende waehrend der Suche nach der Direktive fuer die vorkompilierte Header-Datei
    ic.cpp
    c:\improved console\ic.cpp(323) : fatal error C1010: Unerwartetes Dateiende waehrend der Suche nach der Direktive fuer die vorkompilierte Header-Datei
    Generieren von Code...
    Fehler beim Ausführen von cl.exe.

    Demo.exe - 2 Fehler, 0 Warnung(en)"

    --------------------------------------------------------------------------------
    verwende Visual Studio C++ 6.0 Enterprise

    ich bin wie folgt vorangegangen 😕

    1. Win32 Konsolenanwendung gestartet
    2. die Header Dateien ins Projektverzeichnis kopiert (ic.cpp,ic.hpp)
    3. die Header Dateien mit rechte Maustaste Dateien oder Ordner hinzufügen hinzugeüfgt
    4. demo mover.cpp runtergeladen und main.cpp Code in mein leeres Projekt implementiert

    und der Compiler bringt mir jetzt die folgende Fehlermeldung :

    StdAfx.cpp
    Kompilierung läuft...
    Demo.cpp
    c:\improved console\demo\demo.cpp(105) : fatal error C1010: Unerwartetes Dateiende waehrend der Suche nach der Direktive fuer die vorkompilierte Header-Datei
    ic.cpp
    c:\improved console\ic.cpp(323) : fatal error C1010: Unerwartetes Dateiende waehrend der Suche nach der Direktive fuer die vorkompilierte Header-Datei
    Generieren von Code...
    Fehler beim Ausführen von cl.exe.

    Demo.exe - 2 Fehler, 0 Warnung(en)

    wenn Ihr mir in dieser Hinsicht weiterhelfen könntet würde ich mich sehr freuen.

    MfG DrBrain 👍



  • Dieser Thread wurde von Moderator/in Tim aus dem Forum ANSI C in das Forum DOS und Win32-Konsole verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.



  • Entweder neues Projekt ohne vorcompilierte Header erstellen oder in den Projekteigenschaften vorcompilierte Header abdrehen.

    MfG SideWinder



  • @Tim:
    So, wie ich das sehe, gehört der Thread nach "MFC", weil dort auch die VC-Fragen hinsollen.

    @OP:
    Oder schreib' halt ein #include "stdafx.h".



  • habe die Option vorkompilierte Header nicht verwenden abgedreht und bekomme diese Fehlermedlungen wer kann mir da weiterhelfen ?

    c.cpp
    C:\Improved Console\ic.cpp(9) : error C2065: 'GetConsoleWindow' : nichtdeklarierter Bezeichner
    C:\Improved Console\ic.cpp(12) : error C2440: 'initializing' : 'int' kann nicht in 'struct HWND__ *' konvertiert werden
    Die Konvertierung eines ganzzahligen Typs in einen Zeigertyp erfordert ein reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat
    C:\Improved Console\ic.cpp(12) : error C2439: 'hWnd' : Element konnte nicht initialisiert werden
    C:\Improved Console\ic.hpp(83) : Siehe Deklaration von 'hWnd'
    C:\Improved Console\ic.cpp(173) : error C2065: 'GetConsoleDisplayMode' : nichtdeklarierter Bezeichner
    Fehler beim Ausführen von cl.exe.

    Demo.exe - 4 Fehler, 0 Warnung(en)

    Inhalt von ic.cpp:

    ///// Includes /////////////////////////////////////////////////////////////////
    #include "ic.hpp"
    namespace ic
    {
    ///// Console //////////////////////////////////////////////////////////////
    const COORD Console::origin = {0,0};

    Console::Console ()
    : hWnd(GetConsoleWindow())
    , hConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE))
    , wndBufMode(false)
    {
    HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
    SetConsoleDisplayMode = reinterpret_cast<SETCONSOLEDISPLAYMODE>(GetProcAddress(kernel32,"SetConsoleDisplayMode"));

    disableWndBufMode();
    setWndPos(100,100);
    setWndSize(80,25);
    clear();
    }

    Console::~Console ()
    {
    enableWndBufMode();
    }

    Console& Console::getInstance ()
    {
    static Console instance;
    return instance;
    }

    void Console::hide ()
    {
    ShowWindow(hWnd,SW_HIDE);
    }

    void Console::show ()
    {
    ShowWindow(hWnd,SW_SHOW);
    }

    void Console::minimize ()
    {
    ShowWindow(hWnd,SW_MINIMIZE);
    }

    void Console::maximize ()
    {
    ShowWindow(hWnd,SW_MAXIMIZE);
    }

    void Console::restore ()
    {
    ShowWindow(hWnd,SW_NORMAL);
    }

    void Console::clearColor (Color color)
    {
    DWORD attrsWritten;
    FillConsoleOutputAttribute(hConsoleOutput,color,getWndBufSizeX()*getWndBufSizeY(),origin,&attrsWritten);
    }

    void Console::clearText (TCHAR character)
    {
    DWORD charsWritten;
    FillConsoleOutputCharacter(hConsoleOutput,character,getWndBufSizeX()*getWndBufSizeY(),origin,&charsWritten);
    }

    void Console::clear (Color color, TCHAR character)
    {
    clearColor(color);
    clearText(character);
    }

    TextColor Console::getTextColor () const
    {
    return getTextColor(getCSBI().wAttributes);
    }

    void Console::setTextColor (TextColor color)
    {
    SetConsoleTextAttribute(hConsoleOutput,color|getBgColor());
    }

    BgColor Console::getBgColor () const
    {
    return getBgColor(getCSBI().wAttributes);
    }

    void Console::setBgColor (BgColor color)
    {
    SetConsoleTextAttribute(hConsoleOutput,getTextColor()|color);
    }

    Color Console::getColor () const
    {
    return getCSBI().wAttributes;
    }

    void Console::setColor (Color color)
    {
    SetConsoleTextAttribute(hConsoleOutput,color);
    }

    int Console::getCurPosX () const
    {
    return getCSBI().dwCursorPosition.X;
    }

    int Console::getCurPosY () const
    {
    return getCSBI().dwCursorPosition.Y;
    }

    void Console::setCurPos (int x, int y)
    {
    COORD pos;
    pos.X = x;
    pos.Y = y;
    SetConsoleCursorPosition(hConsoleOutput,pos);
    }

    int Console::getCurSize () const
    {
    CONSOLE_CURSOR_INFO cci = getCCI();

    if(!cci.bVisible)
    return 0;

    return cci.dwSize;
    }

    void Console::setCurSize (int size)
    {
    CONSOLE_CURSOR_INFO cci;

    if(size > 0)
    {
    cci.bVisible = TRUE;
    cci.dwSize = size;
    }
    else
    {
    cci.bVisible = FALSE;
    cci.dwSize = 100;
    }

    SetConsoleCursorInfo(hConsoleOutput,&cci);
    }

    bool Console::isWndBufMode () const
    {
    return wndBufMode;
    }

    void Console::enableWndBufMode ()
    {
    SetConsoleMode(hConsoleOutput,ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT);
    wndBufMode = true;
    }

    void Console::disableWndBufMode ()
    {
    SetConsoleMode(hConsoleOutput,ENABLE_PROCESSED_OUTPUT);
    setWndBufSize(getWndSizeX()+1,getWndSizeY()+1);
    wndBufMode = false;
    }

    bool Console::isWndFSMode () const
    {
    DWORD flags;
    GetConsoleDisplayMode(&flags);

    return flags & CONSOLE_FULLSCREEN_MODE;
    }

    void Console::enableWndFSMode ()
    {
    COORD newScreenBufferDimensions;
    SetConsoleDisplayMode(hConsoleOutput,CONSOLE_FULLSCREEN_MODE,&newScreenBufferDimensions);
    }

    void Console::disableWndFSMode ()
    {
    COORD newScreenBufferDimensions;
    SetConsoleDisplayMode(hConsoleOutput,CONSOLE_WINDOWED_MODE,&newScreenBufferDimensions);
    }

    int Console::getWndPosX () const
    {
    RECT rect;
    GetWindowRect(hWnd,&rect);

    return rect.left;
    }

    int Console::getWndPosY () const
    {
    RECT rect;
    GetWindowRect(hWnd,&rect);

    return rect.top;
    }

    void Console::setWndPos (int x, int y)
    {
    SetWindowPos(hWnd,0,x,y,0,0,SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);
    }

    int Console::getWndBufSizeX () const
    {
    return getCSBI().dwSize.X;
    }

    int Console::getWndBufSizeY () const
    {
    return getCSBI().dwSize.Y;
    }

    void Console::setWndBufSize (int x, int y)
    {
    if(!wndBufMode)
    return;

    COORD size;
    size.X = x;
    size.Y = y;
    SetConsoleScreenBufferSize(hConsoleOutput,size);
    }

    int Console::getWndSizeX () const
    {
    return getCSBI().srWindow.Right - getCSBI().srWindow.Left + 1;
    }

    int Console::getWndSizeY () const
    {
    return getCSBI().srWindow.Bottom - getCSBI().srWindow.Top + 1;
    }

    void Console::setWndSize (int x, int y)
    {
    if(!wndBufMode)
    {
    zeroWndSize();

    COORD bufSize;
    bufSize.X = min(x,getMaxWndSizeX());
    bufSize.Y = min(y,getMaxWndSizeY());
    SetConsoleScreenBufferSize(hConsoleOutput,bufSize);
    }

    SMALL_RECT wndSize;
    wndSize.Top = 0;
    wndSize.Left = 0;
    wndSize.Right = min(x,getMaxWndSizeX()) - 1;
    wndSize.Bottom = min(y,getMaxWndSizeY()) - 1;
    SetConsoleWindowInfo(hConsoleOutput,TRUE,&wndSize);
    }

    int Console::getMaxWndSizeX () const
    {
    return GetLargestConsoleWindowSize(hConsoleOutput).X;
    }

    int Console::getMaxWndSizeY () const
    {
    return GetLargestConsoleWindowSize(hConsoleOutput).Y;
    }

    std::basic_string<TCHAR> Console::getTitle () const
    {
    const int MAX_TITLE_LEN = 64 * 1024;

    TCHAR title [MAX_TITLE_LEN];
    GetConsoleTitle(title,MAX_TITLE_LEN);

    return std::basic_string<TCHAR>(title);
    }

    void Console::setTitle (const std::basic_string<TCHAR>& title)
    {
    SetConsoleTitle(title.c_str());
    }

    CONSOLE_CURSOR_INFO Console::getCCI () const
    {
    CONSOLE_CURSOR_INFO cci;
    GetConsoleCursorInfo(hConsoleOutput,&cci);

    return cci;
    }

    CONSOLE_SCREEN_BUFFER_INFO Console::getCSBI () const
    {
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    GetConsoleScreenBufferInfo(hConsoleOutput,&csbi);

    return csbi;
    }

    void Console::zeroWndSize ()
    {
    SMALL_RECT wndSize;
    wndSize.Top = 1;
    wndSize.Left = 1;
    wndSize.Right = 1;
    wndSize.Bottom = 1;
    SetConsoleWindowInfo(hConsoleOutput,TRUE,&wndSize);

    COORD bufSize;
    bufSize.X = 1;
    bufSize.Y = 1;
    SetConsoleScreenBufferSize(hConsoleOutput,bufSize);
    }

    Console& con = Console::getInstance();
    ////////////////////////////////////////////////////////////////////////////
    }

    danke euch im voraus

    MfG Ertan



  • Du hast nciht die neueste Version des Platform SDK wie auf der IC-Seite beschrieben.

    MfG SideWinder



  • woher bekomme ich die ? könntest du mir da weiterhelfen danke

    MfG Ertan



  • also habe die SDK Cab files runtergeladen und wie beschrieben installiert jedoch geht die Improved Console immer noch nicht ????

    es bringt immer noch die gleiche Fehlermeldung !!!

    C:\Improved Console\ic.cpp(9) : error C2065: 'GetConsoleWindow' : nichtdeklarierter Bezeichner
    C:\Improved Console\ic.cpp(12) : error C2440: 'initializing' : 'int' kann nicht in 'struct HWND__ *' konvertiert werden
    Die Konvertierung eines ganzzahligen Typs in einen Zeigertyp erfordert ein reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat
    C:\Improved Console\ic.cpp(12) : error C2439: 'hWnd' : Element konnte nicht initialisiert werden
    C:\Improved Console\ic.hpp(83) : Siehe Deklaration von 'hWnd'
    C:\Improved Console\ic.cpp(173) : error C2065: 'GetConsoleDisplayMode' : nichtdeklarierter Bezeichner
    Fehler beim Ausführen von cl.exe.
    😕
    Demo.exe - 4 Fehler, 0 Warnung(en)



  • woher bekomme ich die ? könntest du mir da weiterhelfen danke

    Auf der Download-Seite http://ic.sidewindershome.net/Download.php ist das eigentlich unmissverständlich beschrieben.

    Beachte bitte die Einbindung in den MSVC! Es gibt da eine Bat-Datei in der Startmenügruppe die die Einbindung vornimmt!

    MfG SideWinder


Anmelden zum Antworten