<?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[Access Violation und keine Ahnung wieso]]></title><description><![CDATA[<p>Krieg nachdem ich dann Wallpaper gesetzt habe immer ne AV weiß aber überhaupt nicht warum da das programm schon so funktioniert wie ich es mir vorgestellt habe und dann kommt die immer nach dem ändern des desktops <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="😞"
    /><br />
Hier die relevante funktion.Vielleicht weiß jemand den Grund.</p>
<pre><code class="language-cpp">{
    CoInitialize(0);

    HRESULT hr;

    IActiveDesktop *pActiveDesktop;

    hr = CoCreateInstance(::CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
                      IID_IActiveDesktop, (void**)&amp;pActiveDesktop);

 if( SUCCEEDED(hr) )
{

   wchar_t* name;

   int iSize = pfad.WideCharBufSize();

   name = new wchar_t(iSize + 1);

   hr = pActiveDesktop-&gt;SetWallpaper(pfad.WideChar(name,iSize),0);

   WALLPAPEROPT wpo;

   wpo.dwSize = sizeof(WALLPAPEROPT);

   wpo.dwStyle = WPSTYLE_STRETCH ;

   hr = pActiveDesktop-&gt;SetWallpaperOptions(&amp;wpo, 0);

   hr = pActiveDesktop-&gt;ApplyChanges(AD_APPLY_ALL);

   pActiveDesktop-&gt;Release();

   CoUninitialize();

   delete name;
   }

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/95509/access-violation-und-keine-ahnung-wieso</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 17:40:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/95509.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Dec 2004 14:15:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:15:15 GMT]]></title><description><![CDATA[<p>Krieg nachdem ich dann Wallpaper gesetzt habe immer ne AV weiß aber überhaupt nicht warum da das programm schon so funktioniert wie ich es mir vorgestellt habe und dann kommt die immer nach dem ändern des desktops <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="😞"
    /><br />
Hier die relevante funktion.Vielleicht weiß jemand den Grund.</p>
<pre><code class="language-cpp">{
    CoInitialize(0);

    HRESULT hr;

    IActiveDesktop *pActiveDesktop;

    hr = CoCreateInstance(::CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
                      IID_IActiveDesktop, (void**)&amp;pActiveDesktop);

 if( SUCCEEDED(hr) )
{

   wchar_t* name;

   int iSize = pfad.WideCharBufSize();

   name = new wchar_t(iSize + 1);

   hr = pActiveDesktop-&gt;SetWallpaper(pfad.WideChar(name,iSize),0);

   WALLPAPEROPT wpo;

   wpo.dwSize = sizeof(WALLPAPEROPT);

   wpo.dwStyle = WPSTYLE_STRETCH ;

   hr = pActiveDesktop-&gt;SetWallpaperOptions(&amp;wpo, 0);

   hr = pActiveDesktop-&gt;ApplyChanges(AD_APPLY_ALL);

   pActiveDesktop-&gt;Release();

   CoUninitialize();

   delete name;
   }

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/677240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677240</guid><dc:creator><![CDATA[sTyL3X]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:15:15 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:20:03 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">CoUninitialize(); ?????????????
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/677251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677251</guid><dc:creator><![CDATA[fragg]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:20:03 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:21:38 GMT]]></title><description><![CDATA[<p>fragg schrieb:</p>
<blockquote>
<pre><code class="language-cpp">CoUninitialize(); ?????????????
</code></pre>
</blockquote>
<p>Darin liegt es nicht habs mal auskommentiert und die AV kam trotzdem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677255</guid><dc:creator><![CDATA[sTyL3X]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:21:38 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:24:01 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>an welcher Zeile tritt die AV denn auf?<br />
Kann der Fehler davon kommen, dass Du für pActiveDesktop kein gültiges Objekt hast?<br />
Falls Du mit<br />
name = new wchar_t(iSize + 1);<br />
ein Feld anlegen willst, probier es lieber mal mit<br />
name = new wchar_t [iSize + 1];</p>
<p>Gruss<br />
Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677258</guid><dc:creator><![CDATA[Frank71]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:24:01 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:25:05 GMT]]></title><description><![CDATA[<p>An welcher Stelle tritt die AV denn auf(Debugger)???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677261</guid><dc:creator><![CDATA[fragg]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:25:05 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:29:26 GMT]]></title><description><![CDATA[<p>komischerweiße innerhalb des try catch blocks</p>
<pre><code class="language-cpp">WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
        try
        {
                 Application-&gt;Initialize();
                 Application-&gt;CreateForm(__classid(TForm1), &amp;Form1);
                 Application-&gt;Run();
Hier bleibt er stehen    --&gt; }
        catch (Exception &amp;exception)
        {
                 Application-&gt;ShowException(&amp;exception);
        }
        return 0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/677265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677265</guid><dc:creator><![CDATA[sTyL3X]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:29:26 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 14:31:25 GMT]]></title><description><![CDATA[<p>Frank71 schrieb:</p>
<blockquote>
<p>Hallo,</p>
<p>an welcher Zeile tritt die AV denn auf?<br />
Kann der Fehler davon kommen, dass Du für pActiveDesktop kein gültiges Objekt hast?<br />
Falls Du mit<br />
name = new wchar_t(iSize + 1);<br />
ein Feld anlegen willst, probier es lieber mal mit<br />
name = new wchar_t [iSize + 1];</p>
<p>Gruss<br />
Frank</p>
</blockquote>
<p>trivial <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /> <strong>name = new wchar_t(iSize + 1);</strong> anscheinend war es das, denn mit []Klammern kommt sie nicht. Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677271</guid><dc:creator><![CDATA[sTyL3X]]></dc:creator><pubDate>Mon, 20 Dec 2004 14:31:25 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation und keine Ahnung wieso on Mon, 20 Dec 2004 15:16:12 GMT]]></title><description><![CDATA[<p>na, ganz ruhig bleiben, tief Luft holen, auf 10 zaehlen <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="😉"
    /><br />
Aber das soll anderen auch schon passiert sein.</p>
<p>Ciao<br />
Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677316</guid><dc:creator><![CDATA[Frank71]]></dc:creator><pubDate>Mon, 20 Dec 2004 15:16:12 GMT</pubDate></item></channel></rss>