<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[problem, mit klassen variablen ausgabe, brauche hilfe!]]></title><description><![CDATA[<p>hi ich habe hier hier eine kleine anwendung die den process von MineSweeper findet und die zeit in der console ausgibt. doch das problem ist das sich der wert der eigentlich die zeit ist nicht aendert sondern bei 0 stehen bleibt. hier ist der code:</p>
<pre><code class="language-cpp">/*******************************************************************************
*   Data:   Minesweeper.h                                                      *
*   Date:   30th Nov. 2006                                                     *
*******************************************************************************/
#ifndef _MINESWEEPER_H
#define _MINESWEEPER_HH

class MineSweeper {

    public:

        MineSweeper();
        ~MineSweeper();

        void print();
        void getProcess();
        void readProcess();
        void writeProcess();
        bool keyboard();
        bool isrun;

    private:

        HWND hWnd;
        HANDLE hProc;
        DWORD procID, r, w;
        unsigned int address[5];
        int buffer[5];

};

    MineSweeper::MineSweeper() {

        hWnd = 0;
        hProc = 0;
        procID = 0;
        r = 0;
        w = 0;
        address[0] = 0;
        buffer[0] = 0;
        isrun = true;
    }

    MineSweeper::~MineSweeper() {

        hWnd = 0;
        hProc = 0;
        procID = 0;
        r = 0;
        w = 0;
        address[0] = 0;
        buffer[0] = 0;
        isrun = false;
    }

    void MineSweeper::getProcess() {

        cout &lt;&lt; &quot;\n Search process MineSweeper, wait...&quot; &lt;&lt; endl;
        Sleep( 700 );

        hWnd = FindWindow( 0, &quot;MineSweeper&quot; );
            if( !( hWnd ) ) {

                cout &lt;&lt; &quot; Error, couldn't found process MineSweeper.&quot; &lt;&lt; endl;

                getchar();
                isrun = false;
                return;
            }
            else {

                cout &lt;&lt; &quot; All right, process MineSweeper was found.&quot; &lt;&lt; endl;
                Sleep( 700 );
                clrscr();
            }

        GetWindowThreadProcessId( hWnd, &amp;procID );
        hProc = OpenProcess( PROCESS_ALL_ACCESS, 0, procID );
        CloseHandle( hProc );
    }

    bool MineSweeper::keyboard() {

        if( kbhit() ) {

            switch( getch() ) {

                case 27: {

                    isrun = false;
                    break;
                }
            }
        }
        return true;
    }

    void MineSweeper::readProcess() {

        address[0] = 0x100579C;

        ReadProcessMemory( hProc, (LPCVOID)address[0], &amp;buffer[0],
                           sizeof( buffer ), &amp;r );
    }

    void MineSweeper::print() {

        gotoxy( 5, 5 );
        cout &lt;&lt; &quot;   Elapsed Time: &quot; &lt;&lt; buffer[0];
    }

#endif
</code></pre>
<p>und die main</p>
<pre><code class="language-cpp">/*******************************************************************************
*   Data:   MWT1.cpp                                                           *
*   Date:   30th Nov. 2006                                                     *
*******************************************************************************/
#include &lt;conio&gt;
#include &lt;string&gt;
#include &lt;windows.h&gt;
#include &lt;iomanip&gt;
#include &lt;iostream&gt;
    using namespace std;

#pragma hdrstop
#pragma argsused

#include &quot;minesweeper.h&quot;

int main( int argc, char* argv[] ) {

    MineSweeper ms;

    ms.getProcess();

    do {

        ms.readProcess();
        ms.keyboard();
        ms.print();

    } while( ms.isrun );

    ms.~MineSweeper();
    return 0;
}
</code></pre>
<p>könntet ihr mir sagen wo das problem liegt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/166571/problem-mit-klassen-variablen-ausgabe-brauche-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 11:03:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/166571.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Nov 2006 14:48:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problem, mit klassen variablen ausgabe, brauche hilfe! on Thu, 30 Nov 2006 14:48:02 GMT]]></title><description><![CDATA[<p>hi ich habe hier hier eine kleine anwendung die den process von MineSweeper findet und die zeit in der console ausgibt. doch das problem ist das sich der wert der eigentlich die zeit ist nicht aendert sondern bei 0 stehen bleibt. hier ist der code:</p>
<pre><code class="language-cpp">/*******************************************************************************
*   Data:   Minesweeper.h                                                      *
*   Date:   30th Nov. 2006                                                     *
*******************************************************************************/
#ifndef _MINESWEEPER_H
#define _MINESWEEPER_HH

class MineSweeper {

    public:

        MineSweeper();
        ~MineSweeper();

        void print();
        void getProcess();
        void readProcess();
        void writeProcess();
        bool keyboard();
        bool isrun;

    private:

        HWND hWnd;
        HANDLE hProc;
        DWORD procID, r, w;
        unsigned int address[5];
        int buffer[5];

};

    MineSweeper::MineSweeper() {

        hWnd = 0;
        hProc = 0;
        procID = 0;
        r = 0;
        w = 0;
        address[0] = 0;
        buffer[0] = 0;
        isrun = true;
    }

    MineSweeper::~MineSweeper() {

        hWnd = 0;
        hProc = 0;
        procID = 0;
        r = 0;
        w = 0;
        address[0] = 0;
        buffer[0] = 0;
        isrun = false;
    }

    void MineSweeper::getProcess() {

        cout &lt;&lt; &quot;\n Search process MineSweeper, wait...&quot; &lt;&lt; endl;
        Sleep( 700 );

        hWnd = FindWindow( 0, &quot;MineSweeper&quot; );
            if( !( hWnd ) ) {

                cout &lt;&lt; &quot; Error, couldn't found process MineSweeper.&quot; &lt;&lt; endl;

                getchar();
                isrun = false;
                return;
            }
            else {

                cout &lt;&lt; &quot; All right, process MineSweeper was found.&quot; &lt;&lt; endl;
                Sleep( 700 );
                clrscr();
            }

        GetWindowThreadProcessId( hWnd, &amp;procID );
        hProc = OpenProcess( PROCESS_ALL_ACCESS, 0, procID );
        CloseHandle( hProc );
    }

    bool MineSweeper::keyboard() {

        if( kbhit() ) {

            switch( getch() ) {

                case 27: {

                    isrun = false;
                    break;
                }
            }
        }
        return true;
    }

    void MineSweeper::readProcess() {

        address[0] = 0x100579C;

        ReadProcessMemory( hProc, (LPCVOID)address[0], &amp;buffer[0],
                           sizeof( buffer ), &amp;r );
    }

    void MineSweeper::print() {

        gotoxy( 5, 5 );
        cout &lt;&lt; &quot;   Elapsed Time: &quot; &lt;&lt; buffer[0];
    }

#endif
</code></pre>
<p>und die main</p>
<pre><code class="language-cpp">/*******************************************************************************
*   Data:   MWT1.cpp                                                           *
*   Date:   30th Nov. 2006                                                     *
*******************************************************************************/
#include &lt;conio&gt;
#include &lt;string&gt;
#include &lt;windows.h&gt;
#include &lt;iomanip&gt;
#include &lt;iostream&gt;
    using namespace std;

#pragma hdrstop
#pragma argsused

#include &quot;minesweeper.h&quot;

int main( int argc, char* argv[] ) {

    MineSweeper ms;

    ms.getProcess();

    do {

        ms.readProcess();
        ms.keyboard();
        ms.print();

    } while( ms.isrun );

    ms.~MineSweeper();
    return 0;
}
</code></pre>
<p>könntet ihr mir sagen wo das problem liegt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1184627</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1184627</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Thu, 30 Nov 2006 14:48:02 GMT</pubDate></item><item><title><![CDATA[Reply to problem, mit klassen variablen ausgabe, brauche hilfe! on Thu, 30 Nov 2006 14:53:51 GMT]]></title><description><![CDATA[<p>Falsches Forum und arg ungenaue beschreibung wo das Problem liegt.</p>
<p>Kannst Du das Problem ein wenig einschränken ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1184632</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1184632</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Thu, 30 Nov 2006 14:53:51 GMT</pubDate></item><item><title><![CDATA[Reply to problem, mit klassen variablen ausgabe, brauche hilfe! on Thu, 30 Nov 2006 15:05:05 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>...<br />
könntet ihr mir sagen wo das problem liegt?</p>
</blockquote>
<p>Klar, Du hast ein &quot;problem, mit klassen variablen ausgabe, brauche hilfe!&quot;.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1184655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1184655</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Thu, 30 Nov 2006 15:05:05 GMT</pubDate></item><item><title><![CDATA[Reply to problem, mit klassen variablen ausgabe, brauche hilfe! on Thu, 30 Nov 2006 15:34:56 GMT]]></title><description><![CDATA[<p>-.-&quot;... jo sorry... aber mitlerweile hab ich des prob selber gefunden... es lag am CloseHandle( hProc ) logisch das des dann net funktionieren kann, aber trotzdem thx</p>
<p>[CLOSED]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1184698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1184698</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Thu, 30 Nov 2006 15:34:56 GMT</pubDate></item><item><title><![CDATA[Reply to problem, mit klassen variablen ausgabe, brauche hilfe! on Fri, 01 Dec 2006 07:21:53 GMT]]></title><description><![CDATA[<p>Das hat zwar jetzt nichts mit dem Kernproblem zu tun, aber:</p>
<p>T0bi schrieb:</p>
<blockquote>
<pre><code class="language-cpp">#ifndef _MINESWEEPER_H
#define _MINESWEEPER_HH
...
#endif
</code></pre>
</blockquote>
<p>Das ist auf jeden Fall kein funktionsfähiger Include-Guard.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1185038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1185038</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 01 Dec 2006 07:21:53 GMT</pubDate></item></channel></rss>