<?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[Probleme mit MVC2005Express &amp;amp; GDI+]]></title><description><![CDATA[<p>Hallo ans Forum,</p>
<p>habe natürlich dafür das ich mit C++ starte denkbar doofe Anfangsbedingungen<br />
da sehr speziell.</p>
<p>AMD64 mit XP64 als Betriebssystem<br />
MVC2005Express als IDE</p>
<p>Stoße oft bei Tutorials auf das Problem das ich einfache *.cpp &amp; *.h Dateien vorfinde<br />
aber nicht verstehe wie ich die dann in meiner IDE zum laufen bekomme.<br />
Wollte jetzt mit GDI+ ein wendig rumprobieren und bin wie folgt vorgegangen.</p>
<p>1. File/New Project =&gt; General/Empty Project =&gt; OK<br />
Dann:<br />
2. Project/Add New Item =&gt; main.cpp =&gt; OK<br />
und hier dann den Code vom der Microsoft-Seite eingepasted.</p>
<pre><code>#define UNICODE
#include &lt;windows.h&gt;
#include &lt;gdiplus.h&gt;
using namespace Gdiplus;

VOID OnPaint(HDC hdc)
{
   Graphics graphics(hdc);
   Pen      pen(Color(255, 0, 0, 255));
   graphics.DrawLine(&amp;pen, 0, 0, 200, 100);
}

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)
{
   HWND                hWnd;
   MSG                 msg;
   WNDCLASS            wndClass;
   GdiplusStartupInput gdiplusStartupInput;
   ULONG_PTR           gdiplusToken;

   // Initialize GDI+.
   GdiplusStartup(&amp;gdiplusToken, &amp;gdiplusStartupInput, NULL);

   wndClass.style          = CS_HREDRAW | CS_VREDRAW;
   wndClass.lpfnWndProc    = WndProc;
   wndClass.cbClsExtra     = 0;
   wndClass.cbWndExtra     = 0;
   wndClass.hInstance      = hInstance;
   wndClass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
   wndClass.hCursor        = LoadCursor(NULL, IDC_ARROW);
   wndClass.hbrBackground  = (HBRUSH)GetStockObject(WHITE_BRUSH);
   wndClass.lpszMenuName   = NULL;
   wndClass.lpszClassName  = TEXT(&quot;GettingStarted&quot;);

   RegisterClass(&amp;wndClass);

   hWnd = CreateWindow(
      TEXT(&quot;GettingStarted&quot;),   // window class name
      TEXT(&quot;Getting Started&quot;),  // window caption
      WS_OVERLAPPEDWINDOW,      // window style
      CW_USEDEFAULT,            // initial x position
      CW_USEDEFAULT,            // initial y position
      CW_USEDEFAULT,            // initial x size
      CW_USEDEFAULT,            // initial y size
      NULL,                     // parent window handle
      NULL,                     // window menu handle
      hInstance,                // program instance handle
      NULL);                    // creation parameters

   ShowWindow(hWnd, iCmdShow);
   UpdateWindow(hWnd);

   while(GetMessage(&amp;msg, NULL, 0, 0))
   {
      TranslateMessage(&amp;msg);
      DispatchMessage(&amp;msg);
   }

   GdiplusShutdown(gdiplusToken);
   return msg.wParam;
}  // WinMain

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, 
   WPARAM wParam, LPARAM lParam)
{
   HDC          hdc;
   PAINTSTRUCT  ps;

   switch(message)
   {
   case WM_PAINT:
      hdc = BeginPaint(hWnd, &amp;ps);
      OnPaint(hdc);
      EndPaint(hWnd, &amp;ps);
      return 0;
   case WM_DESTROY:
      PostQuitMessage(0);
      return 0;
   default:
      return DefWindowProc(hWnd, message, wParam, lParam);
   }
} // WndProc
</code></pre>
<p>Und bekomme dann Fehlermeldungen wie diese</p>
<blockquote>
<p>1&gt;main.obj : error LNK2019: unresolved external symbol _GdipCreatePen1@16 referenced in function &quot;public: __thiscall Gdiplus::Pen::Pen(class Gdiplus::Color const &amp;,float)&quot; (??0Pen@Gdiplus@@QAE@ABVColor@1@M@Z)</p>
</blockquote>
<p>Ich habe mich mal an ein paar Tutorials von Allegro gesetzt.<br />
Das hat bisher ganz gut geklappt. Wollte jetzt aber die GDI+- Bibliothek zusätzlich nutzen,<br />
da Allegro nicht in Nachkommastellen sauber rotieren kann.<br />
Auch das Alpha-Blending ist in Allegro nicht möglich.<br />
Vielleicht muß ich auch auf Allegro verzichten.<br />
Nur habe ich bisher kein einziges GDI+Script zum laufen bekommen.<br />
Vielleicht könnt ihr mir helfen.</p>
<p>Vielen Dank</p>
<p>jano</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/153036/probleme-mit-mvc2005express-amp-gdi</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 22:33:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/153036.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Jul 2006 09:44:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit MVC2005Express &amp;amp; GDI+ on Wed, 12 Jul 2006 09:44:45 GMT]]></title><description><![CDATA[<p>Hallo ans Forum,</p>
<p>habe natürlich dafür das ich mit C++ starte denkbar doofe Anfangsbedingungen<br />
da sehr speziell.</p>
<p>AMD64 mit XP64 als Betriebssystem<br />
MVC2005Express als IDE</p>
<p>Stoße oft bei Tutorials auf das Problem das ich einfache *.cpp &amp; *.h Dateien vorfinde<br />
aber nicht verstehe wie ich die dann in meiner IDE zum laufen bekomme.<br />
Wollte jetzt mit GDI+ ein wendig rumprobieren und bin wie folgt vorgegangen.</p>
<p>1. File/New Project =&gt; General/Empty Project =&gt; OK<br />
Dann:<br />
2. Project/Add New Item =&gt; main.cpp =&gt; OK<br />
und hier dann den Code vom der Microsoft-Seite eingepasted.</p>
<pre><code>#define UNICODE
#include &lt;windows.h&gt;
#include &lt;gdiplus.h&gt;
using namespace Gdiplus;

VOID OnPaint(HDC hdc)
{
   Graphics graphics(hdc);
   Pen      pen(Color(255, 0, 0, 255));
   graphics.DrawLine(&amp;pen, 0, 0, 200, 100);
}

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)
{
   HWND                hWnd;
   MSG                 msg;
   WNDCLASS            wndClass;
   GdiplusStartupInput gdiplusStartupInput;
   ULONG_PTR           gdiplusToken;

   // Initialize GDI+.
   GdiplusStartup(&amp;gdiplusToken, &amp;gdiplusStartupInput, NULL);

   wndClass.style          = CS_HREDRAW | CS_VREDRAW;
   wndClass.lpfnWndProc    = WndProc;
   wndClass.cbClsExtra     = 0;
   wndClass.cbWndExtra     = 0;
   wndClass.hInstance      = hInstance;
   wndClass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
   wndClass.hCursor        = LoadCursor(NULL, IDC_ARROW);
   wndClass.hbrBackground  = (HBRUSH)GetStockObject(WHITE_BRUSH);
   wndClass.lpszMenuName   = NULL;
   wndClass.lpszClassName  = TEXT(&quot;GettingStarted&quot;);

   RegisterClass(&amp;wndClass);

   hWnd = CreateWindow(
      TEXT(&quot;GettingStarted&quot;),   // window class name
      TEXT(&quot;Getting Started&quot;),  // window caption
      WS_OVERLAPPEDWINDOW,      // window style
      CW_USEDEFAULT,            // initial x position
      CW_USEDEFAULT,            // initial y position
      CW_USEDEFAULT,            // initial x size
      CW_USEDEFAULT,            // initial y size
      NULL,                     // parent window handle
      NULL,                     // window menu handle
      hInstance,                // program instance handle
      NULL);                    // creation parameters

   ShowWindow(hWnd, iCmdShow);
   UpdateWindow(hWnd);

   while(GetMessage(&amp;msg, NULL, 0, 0))
   {
      TranslateMessage(&amp;msg);
      DispatchMessage(&amp;msg);
   }

   GdiplusShutdown(gdiplusToken);
   return msg.wParam;
}  // WinMain

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, 
   WPARAM wParam, LPARAM lParam)
{
   HDC          hdc;
   PAINTSTRUCT  ps;

   switch(message)
   {
   case WM_PAINT:
      hdc = BeginPaint(hWnd, &amp;ps);
      OnPaint(hdc);
      EndPaint(hWnd, &amp;ps);
      return 0;
   case WM_DESTROY:
      PostQuitMessage(0);
      return 0;
   default:
      return DefWindowProc(hWnd, message, wParam, lParam);
   }
} // WndProc
</code></pre>
<p>Und bekomme dann Fehlermeldungen wie diese</p>
<blockquote>
<p>1&gt;main.obj : error LNK2019: unresolved external symbol _GdipCreatePen1@16 referenced in function &quot;public: __thiscall Gdiplus::Pen::Pen(class Gdiplus::Color const &amp;,float)&quot; (??0Pen@Gdiplus@@QAE@ABVColor@1@M@Z)</p>
</blockquote>
<p>Ich habe mich mal an ein paar Tutorials von Allegro gesetzt.<br />
Das hat bisher ganz gut geklappt. Wollte jetzt aber die GDI+- Bibliothek zusätzlich nutzen,<br />
da Allegro nicht in Nachkommastellen sauber rotieren kann.<br />
Auch das Alpha-Blending ist in Allegro nicht möglich.<br />
Vielleicht muß ich auch auf Allegro verzichten.<br />
Nur habe ich bisher kein einziges GDI+Script zum laufen bekommen.<br />
Vielleicht könnt ihr mir helfen.</p>
<p>Vielen Dank</p>
<p>jano</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1096272</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1096272</guid><dc:creator><![CDATA[jano]]></dc:creator><pubDate>Wed, 12 Jul 2006 09:44:45 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit MVC2005Express &amp;amp; GDI+ on Thu, 13 Jul 2006 05:31:41 GMT]]></title><description><![CDATA[<p>Ist zwar WINAPI aber es sieht danach aus als fehlt dir eine LIB welche du noch linken musst.<br />
Der Code ist für den Compiler OK und steigt aber beim linken aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1096819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1096819</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Thu, 13 Jul 2006 05:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit MVC2005Express &amp;amp; GDI+ on Thu, 13 Jul 2006 05:48:36 GMT]]></title><description><![CDATA[<p>Ja, es fehlt die gdiplus.lib</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1096824</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1096824</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Thu, 13 Jul 2006 05:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit MVC2005Express &amp;amp; GDI+ on Thu, 13 Jul 2006 05:48:50 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=709" rel="nofollow">dEUs</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1096825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1096825</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 13 Jul 2006 05:48:50 GMT</pubDate></item></channel></rss>