Announcement

Collapse
No announcement yet.

Problem mit CoCreateInstance

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem mit CoCreateInstance

    <html>

    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1">
    <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
    <title>Normale Seite ohne Titel</title>
    </head>

    <body bgcolor="#FFFFFF">

    <p>Hallo, ich versuche gerade das MFC Beispiel von der Site <a
    href="http://msdn.microsoft.com/library/techart/msdn_shellnk1.htm">http://msdn.microsoft.com/library/techart/msdn_shellnk1.htm</a>
    in mein BC5.02 Projekt einzubauen. Nach dem Aptippen einiger
    Zeilen lasse ich meinen Code compilieren und erhalte in der
    CoCreateInstance - Zeile folgende Fehler:</p>

    <p><strong>Type mismatch in parameter 'rclsid' in call to
    'CoCreateInstance'</strong></p>

    <p><strong>Type mismatch in parameter 'riid' in call to
    'CoCreateInstance'</strong></p>

    <p>Wat is denn nu schon wieder los ??? Hier mein Code:</p>

    <pre>
    #include &lt;shlobj.h&gt;

    HRESULT CreateIt(LPCSTR pszShortCutFile, LPSTR pszLink, LPSTR pszDesc)
    {
    HRESULT hres;
    IShellLink* psl;
    hres=CoCreateInstance(
    CLSID_ShellLink, <em>// REFCLSID rclsid</em>
    NULL, <em>// LPUNKNOWN pUnkOuter</em>
    CLSCTX_INPROC_SERVER, <em>// DWORD dwClsContext</em>
    IID_IShellLink, <em>// REFIID riid</em>
    &amp;psl); <em>// LPVOID *ppv</em>

    <em>// weiter bin ich noch nicht</em>
    }

    </pre>

    <p>Wer kann mir helfen ? Danke - Günther </p>

    <p>&nbsp;</p>

    <p>&nbsp;</p>
    </body>
    </html>
    Günther

  • #2
    Hallo
    Was willst du eigentlich mit "CoCreateInstance" machen

    Comment


    • #3
      <html>

      <head>
      <meta http-equiv="Content-Type"
      content="text/html; charset=iso-8859-1">
      <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
      <title>Normale Seite ohne Titel</title>
      </head>

      <body bgcolor="#FFFFFF">

      <p>Was ich mit CoCreateInstance machen will ? Hab ich doch
      geschrieben: Ich wollte das Beispiel der MSDN-Site in mein
      Programm übernehmen. Aber inzwischen funktioniert es :</p>

      <pre>hres=CoCreateInstance(
      <strong>&amp;</strong>CLSID_ShellLink, // REFCLSID rclsid
      NULL, // LPUNKNOWN pUnkOuter
      CLSCTX_INPROC_SERVER, // DWORD dwClsContext
      <strong>&amp;</strong>IID_IShellLink, // REFIID riid
      <strong>(void*)</strong>&amp;psl); // LPVOID *ppv
      </pre>
      </body>
      </html&gt
      Günther

      Comment


      • #4
        Hallo,

        probier mal folgendes:
        HRESULT CreateIt(LPCSTR pszShortCutFile, LPSTR pszLink, LPSTR pszDesc)
        {
        HRESULT hres;
        IShellLink* psl;
        hres=CoCreateInstance(
        &CLSID_ShellLink, // REFCLSID rclsid
        NULL, // LPUNKNOWN pUnkOuter
        CLSCTX_INPROC_SERVER, // DWORD dwClsContext
        &IID_IShellLink, // REFIID riid
        &psl); // LPVOID *ppv // weiter bin ich noch nicht

        Comment


        • #5
          Hallo Andreas, sei mir nicht böse, aber aus diesem unformatierten Code kann ich nicht erkennen, was da denn anders sein soll. Übrigens, mein Problem ist gelöst - siehe Posting 2 vom 17.3.2000 - Gruß - Günthe
          Günther

          Comment

          Working...
          X