<?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[Irrsinnige Fehler]]></title><description><![CDATA[<p>Guten Tag,<br />
nachdem ich mich die halbe Nacht verzweifelt mit dem Problem beschäftigt habe, aber keine Lösung fand, frage ich euch.</p>
<p>Mein Quellcode gibt Fehler aus, die einfach nicht verständlich sind, weil der Text der als Fehler angeprangert wird nicht exestiert.</p>
<p>Die Fehler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> habe ich als Kommentar hinter die funktionen gesetzt.</p>
<pre><code class="language-cpp">BITMAPINFO CreateBitmapInfoStruct(HBITMAP hBmp)
{
    BITMAP bmp;
    PBITMAPINFO pbmi;
    WORD    cClrBits;
    // Retrieve the bitmap color format, width, and height.
    if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&amp;bmp))
        return NULL; //  :D HIER FEHLER NUMMER EINS: 
// conversion from `int' to non-scalar type `BITMAPINFO' requested|

    // Convert the color format to a count of bits.
    cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel);
    if (cClrBits == 1)
        cClrBits = 1;
    else if (cClrBits &lt;= 4)
        cClrBits = 4;
    else if (cClrBits &lt;= 8)
        cClrBits = 8;
    else if (cClrBits &lt;= 16)
        cClrBits = 16;
    else if (cClrBits &lt;= 24)
        cClrBits = 24;
    else cClrBits = 32;

    // Allocate memory for the BITMAPINFO structure. (This structure
    // contains a BITMAPINFOHEADER structure and an array of RGBQUAD
    // data structures.)

    if (cClrBits != 24)
        pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
        sizeof(BITMAPINFOHEADER) +
        sizeof(RGBQUAD) * (1&lt;&lt; cClrBits));

    // There is no RGBQUAD array for the 24-bit-per-pixel format.

    else
        pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
        sizeof(BITMAPINFOHEADER));

    // Initialize the fields in the BITMAPINFO structure.

    pbmi-&gt;bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    pbmi-&gt;bmiHeader.biWidth = bmp.bmWidth;
    pbmi-&gt;bmiHeader.biHeight = bmp.bmHeight;
    pbmi-&gt;bmiHeader.biPlanes = bmp.bmPlanes;
    pbmi-&gt;bmiHeader.biBitCount = bmp.bmBitsPixel;
    if (cClrBits &lt; 24)
        pbmi-&gt;bmiHeader.biClrUsed = (1&lt;&lt;cClrBits);

    // If the bitmap is not compressed, set the BI_RGB flag.
    pbmi-&gt;bmiHeader.biCompression = BI_RGB;

    // Compute the number of bytes in the array of color
    // indices and store the result in biSizeImage.
    // For Windows NT, the width must be DWORD aligned unless
    // the bitmap is RLE compressed. This example shows this.
    // For Windows 95/98/Me, the width must be WORD aligned unless the
    // bitmap is RLE compressed.
    pbmi-&gt;bmiHeader.biSizeImage = ((pbmi-&gt;bmiHeader.biWidth * cClrBits +31) &amp; ~31) /8
        * pbmi-&gt;bmiHeader.biHeight;
    // Set biClrImportant to 0, indicating that all of the
    // device colors are important.
    pbmi-&gt;bmiHeader.biClrImportant = 0;
    return pbmi; // :D HIER FEHLER NUMMER ZWEI:
// conversion from `tagBITMAPINFO*' to non-scalar type `BITMAPINFO' requested| 
}
</code></pre>
<p>Zudem hat der Funktionsaufruf in main ein problem:</p>
<pre><code class="language-cpp">PBITMAPINFO pBitmapInfo = CreateBitmapInfoStruct(hBit);
//  cannot convert `BITMAPINFO' to `tagBITMAPINFO*' in initialization|
</code></pre>
<p>Helft mir bitte!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/230457/irrsinnige-fehler</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 23:26:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/230457.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Dec 2008 00:52:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 00:52:18 GMT]]></title><description><![CDATA[<p>Guten Tag,<br />
nachdem ich mich die halbe Nacht verzweifelt mit dem Problem beschäftigt habe, aber keine Lösung fand, frage ich euch.</p>
<p>Mein Quellcode gibt Fehler aus, die einfach nicht verständlich sind, weil der Text der als Fehler angeprangert wird nicht exestiert.</p>
<p>Die Fehler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> habe ich als Kommentar hinter die funktionen gesetzt.</p>
<pre><code class="language-cpp">BITMAPINFO CreateBitmapInfoStruct(HBITMAP hBmp)
{
    BITMAP bmp;
    PBITMAPINFO pbmi;
    WORD    cClrBits;
    // Retrieve the bitmap color format, width, and height.
    if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&amp;bmp))
        return NULL; //  :D HIER FEHLER NUMMER EINS: 
// conversion from `int' to non-scalar type `BITMAPINFO' requested|

    // Convert the color format to a count of bits.
    cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel);
    if (cClrBits == 1)
        cClrBits = 1;
    else if (cClrBits &lt;= 4)
        cClrBits = 4;
    else if (cClrBits &lt;= 8)
        cClrBits = 8;
    else if (cClrBits &lt;= 16)
        cClrBits = 16;
    else if (cClrBits &lt;= 24)
        cClrBits = 24;
    else cClrBits = 32;

    // Allocate memory for the BITMAPINFO structure. (This structure
    // contains a BITMAPINFOHEADER structure and an array of RGBQUAD
    // data structures.)

    if (cClrBits != 24)
        pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
        sizeof(BITMAPINFOHEADER) +
        sizeof(RGBQUAD) * (1&lt;&lt; cClrBits));

    // There is no RGBQUAD array for the 24-bit-per-pixel format.

    else
        pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
        sizeof(BITMAPINFOHEADER));

    // Initialize the fields in the BITMAPINFO structure.

    pbmi-&gt;bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    pbmi-&gt;bmiHeader.biWidth = bmp.bmWidth;
    pbmi-&gt;bmiHeader.biHeight = bmp.bmHeight;
    pbmi-&gt;bmiHeader.biPlanes = bmp.bmPlanes;
    pbmi-&gt;bmiHeader.biBitCount = bmp.bmBitsPixel;
    if (cClrBits &lt; 24)
        pbmi-&gt;bmiHeader.biClrUsed = (1&lt;&lt;cClrBits);

    // If the bitmap is not compressed, set the BI_RGB flag.
    pbmi-&gt;bmiHeader.biCompression = BI_RGB;

    // Compute the number of bytes in the array of color
    // indices and store the result in biSizeImage.
    // For Windows NT, the width must be DWORD aligned unless
    // the bitmap is RLE compressed. This example shows this.
    // For Windows 95/98/Me, the width must be WORD aligned unless the
    // bitmap is RLE compressed.
    pbmi-&gt;bmiHeader.biSizeImage = ((pbmi-&gt;bmiHeader.biWidth * cClrBits +31) &amp; ~31) /8
        * pbmi-&gt;bmiHeader.biHeight;
    // Set biClrImportant to 0, indicating that all of the
    // device colors are important.
    pbmi-&gt;bmiHeader.biClrImportant = 0;
    return pbmi; // :D HIER FEHLER NUMMER ZWEI:
// conversion from `tagBITMAPINFO*' to non-scalar type `BITMAPINFO' requested| 
}
</code></pre>
<p>Zudem hat der Funktionsaufruf in main ein problem:</p>
<pre><code class="language-cpp">PBITMAPINFO pBitmapInfo = CreateBitmapInfoStruct(hBit);
//  cannot convert `BITMAPINFO' to `tagBITMAPINFO*' in initialization|
</code></pre>
<p>Helft mir bitte!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1635983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1635983</guid><dc:creator><![CDATA[Sodom&amp;amp;Gomora]]></dc:creator><pubDate>Sat, 27 Dec 2008 00:52:18 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 01:18:50 GMT]]></title><description><![CDATA[<p>Alle Fehler haben damit zu tun, dass du andere Typen zurückgibst als sie vom Compiler laut Deklaration erwartet werden. Du musst nur den richtigen Rückgabetyp in der Funktionsdeklaration angeben oder entsprechend casten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1635988</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1635988</guid><dc:creator><![CDATA[O.o]]></dc:creator><pubDate>Sat, 27 Dec 2008 01:18:50 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 10:20:23 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">BITMAPINFO* CreateBitmapInfoStruct(HBITMAP hBmp)
{
    BITMAP bmp;
    static BITMAPINFO *pbmi;
    WORD    cClrBits;
    // Retrieve the bitmap color format, width, and height.
    if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&amp;bmp))
        return (BITMAPINFO*)NULL; //  :D HIER FEHLER NUMMER EINS:
// conversion from `int' to non-scalar type `BITMAPINFO' requested|

    // Convert the color format to a count of bits.
    cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel);
    if (cClrBits == 1)
        cClrBits = 1;
    else if (cClrBits &lt;= 4)
        cClrBits = 4;
    else if (cClrBits &lt;= 8)
        cClrBits = 8;
    else if (cClrBits &lt;= 16)
        cClrBits = 16;
    else if (cClrBits &lt;= 24)
        cClrBits = 24;
    else cClrBits = 32;

    // Allocate memory for the BITMAPINFO structure. (This structure
    // contains a BITMAPINFOHEADER structure and an array of RGBQUAD
    // data structures.)

    if (cClrBits != 24)
        pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
        sizeof(BITMAPINFOHEADER) +
        sizeof(RGBQUAD) * (1&lt;&lt; cClrBits));

    // There is no RGBQUAD array for the 24-bit-per-pixel format.

    else
        pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
        sizeof(BITMAPINFOHEADER));

    // Initialize the fields in the BITMAPINFO structure.

    pbmi-&gt;bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    pbmi-&gt;bmiHeader.biWidth = bmp.bmWidth;
    pbmi-&gt;bmiHeader.biHeight = bmp.bmHeight;
    pbmi-&gt;bmiHeader.biPlanes = bmp.bmPlanes;
    pbmi-&gt;bmiHeader.biBitCount = bmp.bmBitsPixel;
    if (cClrBits &lt; 24)
        pbmi-&gt;bmiHeader.biClrUsed = (1&lt;&lt;cClrBits);

    // If the bitmap is not compressed, set the BI_RGB flag.
    pbmi-&gt;bmiHeader.biCompression = BI_RGB;

    // Compute the number of bytes in the array of color
    // indices and store the result in biSizeImage.
    // For Windows NT, the width must be DWORD aligned unless
    // the bitmap is RLE compressed. This example shows this.
    // For Windows 95/98/Me, the width must be WORD aligned unless the
    // bitmap is RLE compressed.
    pbmi-&gt;bmiHeader.biSizeImage = ((pbmi-&gt;bmiHeader.biWidth * cClrBits +31) &amp; ~31) /8
        * pbmi-&gt;bmiHeader.biHeight;
    // Set biClrImportant to 0, indicating that all of the
    // device colors are important.
    pbmi-&gt;bmiHeader.biClrImportant = 0;
    return pbmi; // :D HIER FEHLER NUMMER ZWEI:
// conversion from `tagBITMAPINFO*' to non-scalar type `BITMAPINFO' requested|
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1636039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636039</guid><dc:creator><![CDATA[CStern]]></dc:creator><pubDate>Sat, 27 Dec 2008 10:20:23 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 11:04:59 GMT]]></title><description><![CDATA[<p>mach den irsinnigen cast bitte raus CStern wir sind hier nicht beim völlig bekloppten c++ sondern bei C!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636052</guid><dc:creator><![CDATA[Sartin Zeuchtel]]></dc:creator><pubDate>Sat, 27 Dec 2008 11:04:59 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 11:18:27 GMT]]></title><description><![CDATA[<p>Sartin Zeuchtel schrieb:</p>
<blockquote>
<p>mach den irsinnigen cast bitte raus CStern wir sind hier nicht beim völlig bekloppten c++ sondern bei C!</p>
</blockquote>
<p>Wir sind hier genauer: Bei WINAPI.</p>
<p>Und was konkret gefällt Dir an diesem:</p>
<p>BITMAPINFO *pbmi;</p>
<p>nicht?</p>
<p>Über das hier:</p>
<p>BITMAPINFO* CreateBitmapInfoStruct(HBITMAP hBmp)</p>
<p>ließe ich mit mir diskutieren. Würde ich auch nicht so machen ...</p>
<p>BOOL CreateBitmapInfoStruct(HBITMAP hBmp, PBITMAPINFO pbmp) ...<br />
vielleicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636059</guid><dc:creator><![CDATA[CStern]]></dc:creator><pubDate>Sat, 27 Dec 2008 11:18:27 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 11:22:39 GMT]]></title><description><![CDATA[<p>Genau! Denn hiervon ist die Rede!</p>
<pre><code class="language-cpp">return (BITMAPINFO*)NULL;
</code></pre>
<p>Ein einfaches NULL ist hier vollkommen ausreichend!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636064</guid><dc:creator><![CDATA[Sartin Zeuchtel]]></dc:creator><pubDate>Sat, 27 Dec 2008 11:22:39 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sat, 27 Dec 2008 11:27:53 GMT]]></title><description><![CDATA[<p>Sartin Zeuchtel schrieb:</p>
<blockquote>
<p>Genau! Denn hiervon ist die Rede!</p>
<pre><code class="language-cpp">return (BITMAPINFO*)NULL;
</code></pre>
<p>Ein einfaches NULL ist hier vollkommen ausreichend!</p>
</blockquote>
<p>Der Meinung bin ich auch. Am besten gar kein Pointer zurückgeben <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1636066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636066</guid><dc:creator><![CDATA[CStern]]></dc:creator><pubDate>Sat, 27 Dec 2008 11:27:53 GMT</pubDate></item><item><title><![CDATA[Reply to Irrsinnige Fehler on Sun, 28 Dec 2008 01:48:25 GMT]]></title><description><![CDATA[<p>In C würde ich vermutlich <code>BOOL CreateBitmapInfoStruct(HBITMAP hBmp, PBITMAPINFO pbmp)</code> machen.<br />
In C++ würde ich <code>BITMAPINFO CreateBitmapInfoStruct(HBITMAP hBmp)</code> oder <code>void CreateBitmapInfoStruct(HBITMAP hBmp, BITMAPINFO&amp; bmi)</code> machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636379</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 28 Dec 2008 01:48:25 GMT</pubDate></item></channel></rss>