<?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[shared data in dll]]></title><description><![CDATA[<p>hola leute</p>
<p>weiß jemand wie ich eine variable fuer jede instanz einer dll erstellen kann ?<br />
hab es nach dem beispiel von <a href="http://bdn.borland.com/article/0,1410,20008,00.html" rel="nofollow">http://bdn.borland.com/article/0,1410,20008,00.html</a><br />
probiert. aber da bekomme ich immer den fehler das es die #pragma optionen -zR und -zT nicht gibt. kennt sich da jemand aus ? oder gibt es sonst noch einen trick wie man so ne art globale variable erstellen kann ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133800/shared-data-in-dll</link><generator>RSS for Node</generator><lastBuildDate>Fri, 31 Jul 2026 21:40:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133800.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Jan 2006 21:39:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to shared data in dll on Fri, 20 Jan 2006 21:39:25 GMT]]></title><description><![CDATA[<p>hola leute</p>
<p>weiß jemand wie ich eine variable fuer jede instanz einer dll erstellen kann ?<br />
hab es nach dem beispiel von <a href="http://bdn.borland.com/article/0,1410,20008,00.html" rel="nofollow">http://bdn.borland.com/article/0,1410,20008,00.html</a><br />
probiert. aber da bekomme ich immer den fehler das es die #pragma optionen -zR und -zT nicht gibt. kennt sich da jemand aus ? oder gibt es sonst noch einen trick wie man so ne art globale variable erstellen kann ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971751</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971751</guid><dc:creator><![CDATA[(Meep Meep)]]></dc:creator><pubDate>Fri, 20 Jan 2006 21:39:25 GMT</pubDate></item><item><title><![CDATA[Reply to shared data in dll on Sat, 21 Jan 2006 04:51:28 GMT]]></title><description><![CDATA[<p>mit shared memmry</p>
<pre><code class="language-cpp">HINSTANCE hinstglob;
static LPVOID lpvMem=NULL;

int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
hinstglob=hinst;
HANDLE hMapObject=NULL;
BOOL fInit,fIgnore;
switch(reason)
   {
	case DLL_PROCESS_ATTACH:
		hMapObject = CreateFileMapping((HANDLE) 0xFFFFFFFF,NULL,PAGE_READWRITE,0,4096,&quot;dllmemfilemap&quot;);
		if(hMapObject==NULL)
			return FALSE;
		fInit=(GetLastError()!=ERROR_ALREADY_EXISTS);
		lpvMem=MapViewOfFile(hMapObject,FILE_MAP_WRITE,0,0,0);
		if(lpvMem==NULL)
			return FALSE;
		if(fInit)
		memset(lpvMem,0,4096);
	break;

	case DLL_THREAD_ATTACH:
	break;

	case DLL_THREAD_DETACH:
	break;

	case DLL_PROCESS_DETACH:
		fIgnore=UnmapViewOfFile(lpvMem);
		fIgnore=CloseHandle(hMapObject);
	break;
	}
return 1;
}
//---------------------------------------------------------------------------
</code></pre>
<p>LPVOID lpvMem=NULL;<br />
ist dann der Bereich (hier 4096 Bytes) den du gemeinsam nutzen kannst</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971854</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Sat, 21 Jan 2006 04:51:28 GMT</pubDate></item></channel></rss>