<?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[Suche Hilfe bei DLL-Problem]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe eine DLL zum Dekomprimieren von WinZip-Dateien geschrieben. Sie basiert auf XZIP.<br />
Mein Problem ist, dass beim Aufruf der Dekompress-Funktion immer eine Zugriffsverletzung auftritt.</p>
<p>Ich hoffe, dass mir hier jemand helfen kann und bin euch für jeden Tipp dankbar!</p>
<p>Der Code der DLL:</p>
<pre><code>#include &quot;XZip.cpp&quot;
#include &quot;XUnzip.cpp&quot;

#include &quot;dll.h&quot;
#include &quot;zip_dll.h&quot;

BOOL WINAPI LibMain(HINSTANCE hDllInst, DWORD fdwReason, LPVOID lpvReserved)
{
  switch(fdwReason)
  {
    case DLL_PROCESS_ATTACH:
      break;
    case DLL_PROCESS_DETACH:
      break;
    case DLL_THREAD_ATTACH:
      break;
    case DLL_THREAD_DETACH:
      break;
  }
  return(TRUE);
}

DLLEXPORT HANDLE OpenZipArchive(PSTR sArchiveName,BOOL bCreate)
{
  HANDLE hZip;

  hZip=OpenZip(sArchiveName,0,ZIP_FILENAME);
  if(hZip) return(hZip);
  else if(bCreate) return(CreateZip(sArchiveName,0,ZIP_FILENAME));
  else return(NULL);
}

DLLEXPORT DWORD ZipAddFile(HANDLE hZip,PSTR sFileName)
{
  if(ZipAdd((HZIP)hZip,sFileName,sFileName,0,ZIP_FILENAME)!=ZR_OK) return(NULL);
  else return(1);
}

DLLEXPORT DWORD GetZipItemsCount(HANDLE hZip)
{
  ZIPENTRY ze;

  GetZipItem((HZIP)hZip,-1,&amp;ze);
  return(ze.index);
}

DLLEXPORT DWORD UnZipFile(HANDLE hZip,DWORD dwIndex)
{
  ZIPENTRY *ze;

  ze=(ZIPENTRY*)malloc(sizeof(ZIPENTRY));
  if(GetZipItem((HZIP)hZip,dwIndex,&amp;ze)==ZR_OK)
  {
    ze-&gt;name=(char*)malloc(256);
    strcpy(ze-&gt;name,&quot;text.txt&quot;);
    if(UnzipItem((HZIP)hZip,dwIndex,&quot;test.zip&quot;/*ze-&gt;name*/,0,ZIP_FILENAME)!=ZR_OK) return(NULL);
    else return(1);
  }
  else return(NULL);
}

DLLEXPORT DWORD CloseArchive(HANDLE hZip)
{
  CloseZip((HZIP)hZip);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/105248/suche-hilfe-bei-dll-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 06:34:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/105248.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Mar 2005 13:56:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Suche Hilfe bei DLL-Problem on Mon, 28 Mar 2005 13:56:33 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe eine DLL zum Dekomprimieren von WinZip-Dateien geschrieben. Sie basiert auf XZIP.<br />
Mein Problem ist, dass beim Aufruf der Dekompress-Funktion immer eine Zugriffsverletzung auftritt.</p>
<p>Ich hoffe, dass mir hier jemand helfen kann und bin euch für jeden Tipp dankbar!</p>
<p>Der Code der DLL:</p>
<pre><code>#include &quot;XZip.cpp&quot;
#include &quot;XUnzip.cpp&quot;

#include &quot;dll.h&quot;
#include &quot;zip_dll.h&quot;

BOOL WINAPI LibMain(HINSTANCE hDllInst, DWORD fdwReason, LPVOID lpvReserved)
{
  switch(fdwReason)
  {
    case DLL_PROCESS_ATTACH:
      break;
    case DLL_PROCESS_DETACH:
      break;
    case DLL_THREAD_ATTACH:
      break;
    case DLL_THREAD_DETACH:
      break;
  }
  return(TRUE);
}

DLLEXPORT HANDLE OpenZipArchive(PSTR sArchiveName,BOOL bCreate)
{
  HANDLE hZip;

  hZip=OpenZip(sArchiveName,0,ZIP_FILENAME);
  if(hZip) return(hZip);
  else if(bCreate) return(CreateZip(sArchiveName,0,ZIP_FILENAME));
  else return(NULL);
}

DLLEXPORT DWORD ZipAddFile(HANDLE hZip,PSTR sFileName)
{
  if(ZipAdd((HZIP)hZip,sFileName,sFileName,0,ZIP_FILENAME)!=ZR_OK) return(NULL);
  else return(1);
}

DLLEXPORT DWORD GetZipItemsCount(HANDLE hZip)
{
  ZIPENTRY ze;

  GetZipItem((HZIP)hZip,-1,&amp;ze);
  return(ze.index);
}

DLLEXPORT DWORD UnZipFile(HANDLE hZip,DWORD dwIndex)
{
  ZIPENTRY *ze;

  ze=(ZIPENTRY*)malloc(sizeof(ZIPENTRY));
  if(GetZipItem((HZIP)hZip,dwIndex,&amp;ze)==ZR_OK)
  {
    ze-&gt;name=(char*)malloc(256);
    strcpy(ze-&gt;name,&quot;text.txt&quot;);
    if(UnzipItem((HZIP)hZip,dwIndex,&quot;test.zip&quot;/*ze-&gt;name*/,0,ZIP_FILENAME)!=ZR_OK) return(NULL);
    else return(1);
  }
  else return(NULL);
}

DLLEXPORT DWORD CloseArchive(HANDLE hZip)
{
  CloseZip((HZIP)hZip);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/754179</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/754179</guid><dc:creator><![CDATA[zip_dll]]></dc:creator><pubDate>Mon, 28 Mar 2005 13:56:33 GMT</pubDate></item><item><title><![CDATA[Reply to Suche Hilfe bei DLL-Problem on Mon, 28 Mar 2005 14:11:13 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>meist Du diese Zeile:<br />
...<br />
if(GetZipItem((HZIP)hZip,dwIndex,&amp;ze)==ZR_OK)<br />
...</p>
<p>ich kenne XZip nicht aber ich kann mir vorstellen, daß es nicht &quot;&amp;ze&quot; sondern nur &quot;ze&quot; heißen muß. &quot;ze&quot; ist ja schon ein Zeiger.</p>
<p>Oder statt<br />
ZIPENTRY *ze;<br />
besser<br />
ZIPENTRY ze;<br />
schreiben und dann aber &quot;&amp;ze&quot; verwenden !</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/754184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/754184</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Mon, 28 Mar 2005 14:11:13 GMT</pubDate></item></channel></rss>