<?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[Fehler mit IShellLink]]></title><description><![CDATA[<p>Egal was ich tue: Die Fehler bleiben.<br />
Die Fehler treten auf, wenn ich folgenden Snippet von BytesAndMore anwende:</p>
<pre><code>bool ReadShortcut(TShortcutCfg* sCfg, AnsiString slFileName)
{
  bool blRetVal = true;   // Rückgabewert
  wchar_t wsz [MAX_PATH]; // Buffer für Unicode String
  char buf[MAX_PATH];
  IShellLink *psl;
  slFileName.WideChar(wsz, MAX_PATH);

  if(blRetVal)
  {
    // COM-Bibliothek initialisieren
    blRetVal = CoInitialize(NULL) == S_OK;
    if(blRetVal)
    {
      // IShellLink Objekt erzeugen
      blRetVal = CoCreateInstance (CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
        IID_IShellLink, (void **)&amp;psl) &gt;= 0;

      if(blRetVal)
      {
        IPersistFile *ppf;

         // The IShellLink Interface supports the IPersistFile
         // interface. Get an interface pointer to it.
        blRetVal = psl-&gt;QueryInterface(IID_IPersistFile, (void **)&amp;ppf) &gt;= 0;

        // Zeiger auf IPersistFile-Interface (zum Speichern der
        // Verknüpfung) besorgen
        if(blRetVal)
        {
          // Verknüpfungsdatei laden:
          blRetVal = ppf-&gt;Load(wsz, TRUE) &gt;= 0;

          // Zieldatei der Verknüpfung lesen
          if(blRetVal)
          {
            // Zieldatei der Verknüpfung lesen:
            psl-&gt;GetPath(buf, MAX_PATH, NULL, 0);
            sCfg-&gt;slDestFile = AnsiString(buf);

            // Übergabeparameter der Verknüpfung lesen
            psl-&gt;GetArguments(buf, MAX_PATH);
            sCfg-&gt;slArguments = AnsiString(buf);

            // Symbolinformationen lesen:
            int ilIndex = 0;
            if(psl-&gt;GetIconLocation(buf, MAX_PATH, &amp;ilIndex) == NOERROR)
            {
              sCfg-&gt;slIconFile = AnsiString(buf);
              sCfg-&gt;ilIconIndex = ilIndex &gt;= 0 ? ilIndex : 0;
            }

            // Arbeitsverzeichnis der Verknüpfung lesen
            psl-&gt;GetWorkingDirectory(buf, MAX_PATH);
            sCfg-&gt;slWorkingDir = AnsiString(buf);

            // Kommentar für die Verknüpfung lesen
            psl-&gt;GetDescription(buf, MAX_PATH);
            sCfg-&gt;slDescription = AnsiString(buf);

            // Hotkey zuweisen:
            psl-&gt;GetHotkey(&amp;sCfg-&gt;wlHotKey);

            // Fenster-Modus zuweisen:
            psl-&gt;GetShowCmd(&amp;sCfg-&gt;ilShowCmd);

          }
          // Zeiger auf IPersistFile freigeben
          ppf-&gt;Release ();
        }

        // Zeiger auf IShellLink freigeben
        psl-&gt;Release ();
      }
      // COM-Bibliothek freigeben
      CoUninitialize();
    }
    if(blRetVal)
    {
      sCfg-&gt;slLnkDir = IncludeTrailingBackslash(ExtractFilePath(slFileName));
      slFileName = ExtractFileName(slFileName);
      sCfg-&gt;slShortcutName = slFileName.Length() ? slFileName.
        SubString(1, slFileName.Length()-ExtractFileExt(
        slFileName).Length()) : EmptyStr;
    }
  }
  return blRetVal;
}
</code></pre>
<p>Folgende Header-Einstellungen habe ich schon drin:</p>
<pre><code>#define NO_WIN32_LEAN_AND_MEAN
#include &quot;shlobj.hpp&quot;
#include &quot;filectrl.hpp&quot;
#include &quot;Desktop.h&quot;
#include &quot;objbase.h&quot;
</code></pre>
<p>Aber trotzdem erhalte ich diese Fehler:</p>
<pre><code>[C++ Error] Desktop.cpp(47): E2451 Undefined symbol 'IShellLink'
[C++ Error] Desktop.cpp(47): E2451 Undefined symbol 'psl'
[C++ Error] Desktop.cpp(57): E2451 Undefined symbol 'CLSID_ShellLink'
[C++ Error] Desktop.cpp(58): E2451 Undefined symbol 'IID_IShellLink'
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/97286/fehler-mit-ishelllink</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 18:26:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/97286.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Jan 2005 12:22:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler mit IShellLink on Sun, 09 Jan 2005 12:22:49 GMT]]></title><description><![CDATA[<p>Egal was ich tue: Die Fehler bleiben.<br />
Die Fehler treten auf, wenn ich folgenden Snippet von BytesAndMore anwende:</p>
<pre><code>bool ReadShortcut(TShortcutCfg* sCfg, AnsiString slFileName)
{
  bool blRetVal = true;   // Rückgabewert
  wchar_t wsz [MAX_PATH]; // Buffer für Unicode String
  char buf[MAX_PATH];
  IShellLink *psl;
  slFileName.WideChar(wsz, MAX_PATH);

  if(blRetVal)
  {
    // COM-Bibliothek initialisieren
    blRetVal = CoInitialize(NULL) == S_OK;
    if(blRetVal)
    {
      // IShellLink Objekt erzeugen
      blRetVal = CoCreateInstance (CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
        IID_IShellLink, (void **)&amp;psl) &gt;= 0;

      if(blRetVal)
      {
        IPersistFile *ppf;

         // The IShellLink Interface supports the IPersistFile
         // interface. Get an interface pointer to it.
        blRetVal = psl-&gt;QueryInterface(IID_IPersistFile, (void **)&amp;ppf) &gt;= 0;

        // Zeiger auf IPersistFile-Interface (zum Speichern der
        // Verknüpfung) besorgen
        if(blRetVal)
        {
          // Verknüpfungsdatei laden:
          blRetVal = ppf-&gt;Load(wsz, TRUE) &gt;= 0;

          // Zieldatei der Verknüpfung lesen
          if(blRetVal)
          {
            // Zieldatei der Verknüpfung lesen:
            psl-&gt;GetPath(buf, MAX_PATH, NULL, 0);
            sCfg-&gt;slDestFile = AnsiString(buf);

            // Übergabeparameter der Verknüpfung lesen
            psl-&gt;GetArguments(buf, MAX_PATH);
            sCfg-&gt;slArguments = AnsiString(buf);

            // Symbolinformationen lesen:
            int ilIndex = 0;
            if(psl-&gt;GetIconLocation(buf, MAX_PATH, &amp;ilIndex) == NOERROR)
            {
              sCfg-&gt;slIconFile = AnsiString(buf);
              sCfg-&gt;ilIconIndex = ilIndex &gt;= 0 ? ilIndex : 0;
            }

            // Arbeitsverzeichnis der Verknüpfung lesen
            psl-&gt;GetWorkingDirectory(buf, MAX_PATH);
            sCfg-&gt;slWorkingDir = AnsiString(buf);

            // Kommentar für die Verknüpfung lesen
            psl-&gt;GetDescription(buf, MAX_PATH);
            sCfg-&gt;slDescription = AnsiString(buf);

            // Hotkey zuweisen:
            psl-&gt;GetHotkey(&amp;sCfg-&gt;wlHotKey);

            // Fenster-Modus zuweisen:
            psl-&gt;GetShowCmd(&amp;sCfg-&gt;ilShowCmd);

          }
          // Zeiger auf IPersistFile freigeben
          ppf-&gt;Release ();
        }

        // Zeiger auf IShellLink freigeben
        psl-&gt;Release ();
      }
      // COM-Bibliothek freigeben
      CoUninitialize();
    }
    if(blRetVal)
    {
      sCfg-&gt;slLnkDir = IncludeTrailingBackslash(ExtractFilePath(slFileName));
      slFileName = ExtractFileName(slFileName);
      sCfg-&gt;slShortcutName = slFileName.Length() ? slFileName.
        SubString(1, slFileName.Length()-ExtractFileExt(
        slFileName).Length()) : EmptyStr;
    }
  }
  return blRetVal;
}
</code></pre>
<p>Folgende Header-Einstellungen habe ich schon drin:</p>
<pre><code>#define NO_WIN32_LEAN_AND_MEAN
#include &quot;shlobj.hpp&quot;
#include &quot;filectrl.hpp&quot;
#include &quot;Desktop.h&quot;
#include &quot;objbase.h&quot;
</code></pre>
<p>Aber trotzdem erhalte ich diese Fehler:</p>
<pre><code>[C++ Error] Desktop.cpp(47): E2451 Undefined symbol 'IShellLink'
[C++ Error] Desktop.cpp(47): E2451 Undefined symbol 'psl'
[C++ Error] Desktop.cpp(57): E2451 Undefined symbol 'CLSID_ShellLink'
[C++ Error] Desktop.cpp(58): E2451 Undefined symbol 'IID_IShellLink'
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/691452</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/691452</guid><dc:creator><![CDATA[Diabolo]]></dc:creator><pubDate>Sun, 09 Jan 2005 12:22:49 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler mit IShellLink on Sun, 09 Jan 2005 12:45:41 GMT]]></title><description><![CDATA[<p>Evtl. noch shobjidl.h <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/691473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/691473</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 09 Jan 2005 12:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler mit IShellLink on Sun, 09 Jan 2005 13:03:10 GMT]]></title><description><![CDATA[<p>Mhh danke... leider erhalte ich ein paar multideklaration Fehler. Die fehlerverursachenden Fehler habe ich ganz vorsichtig auskommentiert. Nun läuft das Programm reibungslos, aber</p>
<pre><code>AnsiString Datei=Path+&quot;\\&quot;+FoundFile;
TShortcutCfg *Shortcut;
bool erfolg=ReadShortcut(Shortcut,Datei); //bis der Laufzeitfehler kommt ist erfolg immer 0
ReadShortcut(Shortcut,Datei);
</code></pre>
<p>es gibt einen Laufzeitfehler aus:</p>
<pre><code>Project Taskbar.exe raised exception class EAccessViolation with message
'Access violation at address 00458B60 in module 'Taskbar.exe'. Read of address
8B004D99'. Process stopped. Use Step or Run to continue.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/691498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/691498</guid><dc:creator><![CDATA[Diabolo]]></dc:creator><pubDate>Sun, 09 Jan 2005 13:03:10 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler mit IShellLink on Sun, 09 Jan 2005 13:58:24 GMT]]></title><description><![CDATA[<p>Da ich von COM keine Ahnung habe kann ich dir zwar nicht direkt weiterhelfen, aber du kannst auf jeden Fall nicht einfach irgendwelche Zeilen auskommentieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/691557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/691557</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 09 Jan 2005 13:58:24 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler mit IShellLink on Sun, 09 Jan 2005 18:28:00 GMT]]></title><description><![CDATA[<p>Wie kann ich dann aber Fehler wegkriegen... Es liegt ja immerhin an den Headern und nicht an mir oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/691837</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/691837</guid><dc:creator><![CDATA[Diabolo]]></dc:creator><pubDate>Sun, 09 Jan 2005 18:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler mit IShellLink on Sun, 09 Jan 2005 22:45:48 GMT]]></title><description><![CDATA[<p>Diabolo schrieb:</p>
<blockquote>
<p>Wie kann ich dann aber Fehler wegkriegen... Es liegt ja immerhin an den Headern und nicht an mir oder?</p>
</blockquote>
<p>die Header sind OK, also Finger weg, Filectrl.hpp und shlobj.hpp reichen (WIN32_Le..... auch rein)</p>
<p>Der Fehler liegt sicherlich woanders, an einstellungen von deinem BCB oder so, oder wie auch immer.</p>
<p>bei mir funzt es einwandfrei</p>
]]></description><link>https://www.c-plusplus.net/forum/post/692032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/692032</guid><dc:creator><![CDATA[alles ok]]></dc:creator><pubDate>Sun, 09 Jan 2005 22:45:48 GMT</pubDate></item></channel></rss>