<?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[Hinstance]]></title><description><![CDATA[<p>Ist es möglich eine hinstance aus einer Methode aus einer klasse zu bekommen die nicht statisch ist?</p>
<pre><code class="language-cpp">MEMORY_BASIC_INFORMATION mbi;
        VirtualQuery(this-&gt;NewWindow,&amp;mbi,sizeof(mbi));
	hInstance = (HINSTANCE)mbi.AllocationBase;
</code></pre>
<p>geht nicht</p>
<p>thx</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/94513/hinstance</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 01:00:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/94513.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Dec 2004 18:59:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hinstance on Thu, 09 Dec 2004 18:59:51 GMT]]></title><description><![CDATA[<p>Ist es möglich eine hinstance aus einer Methode aus einer klasse zu bekommen die nicht statisch ist?</p>
<pre><code class="language-cpp">MEMORY_BASIC_INFORMATION mbi;
        VirtualQuery(this-&gt;NewWindow,&amp;mbi,sizeof(mbi));
	hInstance = (HINSTANCE)mbi.AllocationBase;
</code></pre>
<p>geht nicht</p>
<p>thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/669855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/669855</guid><dc:creator><![CDATA[spjoe]]></dc:creator><pubDate>Thu, 09 Dec 2004 18:59:51 GMT</pubDate></item><item><title><![CDATA[Reply to Hinstance on Thu, 09 Dec 2004 21:00:29 GMT]]></title><description><![CDATA[<p>ich weis nicht genau was du machst aber so vielleicht</p>
<pre><code class="language-cpp">HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);
</code></pre>
<p><a href="http://msdn.microsoft.com/library/en-us/dllproc/base/getmodulehandle.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/dllproc/base/getmodulehandle.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/669977</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/669977</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 09 Dec 2004 21:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to Hinstance on Thu, 09 Dec 2004 21:21:42 GMT]]></title><description><![CDATA[<p>Hilft mir leider nicht brauch wirklich die Hinstance einer bestimmten funktion;<br />
Das Problem ist das die Funktion keine Globale funktion ist sondern eine Methode einer Klasse. make_winapp ist static! Oder kann mir jemand sagen wie ich mehrer Wnds RegisterClassEx(&amp;windowClass)) registrieren kann? Ich meine pro Fenster ein Thread wären</p>
<pre><code class="language-cpp">void CAVLTree_OpenGl::_init_window(){

	m_hnd = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)make_winapp, this, 0, NULL);
}

DWORD WINAPI CAVLTree_OpenGl::make_winapp(LPVOID dummy) {
	HINSTANCE hi = 0;
	char string[] = &quot;Avl Tree OpenGl Ausgabe&quot;;

	CAVLTree_OpenGl * pthis = ((CAVLTree_OpenGl*)dummy);

	pthis-&gt;WinMain(hi, main_HInc, string, SW_MAXIMIZE);

	CloseHandle(pthis-&gt;m_hnd);
	pthis-&gt;m_hnd = NULL;

	return 0;
}
WPARAM WINAPI CAVLTree_OpenGl::WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){
	WNDCLASSEX windowClass;  // Variable meiner Wnd Klasse
	MSG		msg;			 // message
	bool done = false;		 // flag fr message loop(wenn app fertig(WM_QUIT)

//	MEMORY_BASIC_INFORMATION mbi;  
//	VirtualQuery(this-&gt;WinMain,&amp;mbi,sizeof(mbi));//Dss geht Nicht
//	hInstance = (HINSTANCE)mbi.AllocationBase;

	/* ATTRIBUTE DER windowClass */
	windowClass.cbSize = sizeof(WNDCLASSEX);		// gr�se der WND struktur
	windowClass.style = CS_VREDRAW | CS_HREDRAW;	// Neuzeichnen
	windowClass.lpfnWndProc = (WNDPROC)WndProc;		// Funktions Zeiger definieren
	windowClass.cbClsExtra = 0;						// keine Extra Bytes
	windowClass.cbWndExtra = 0; 
	windowClass.hInstance = hInstance;				// hInstance dieser Applikation denken!!!!!!
	windowClass.hIcon = LoadIcon(0, IDI_APPLICATION);// standard icon
	windowClass.hCursor = LoadCursor(0, IDC_ARROW); // standard WND Cursor laden
	windowClass.hbrBackground = 0;					// kein Hintergrund brush	
	windowClass.lpszMenuName = 0;					// kein Men
	windowClass.lpszClassName = &quot;Meine Klasse!&quot;;	// Name der WND Klasse
	windowClass.hIconSm = LoadIcon(0, IDI_WINLOGO);	// kleines icon

	// registriere diese Klasse (gib adr. an windows)
	// ACHTUNG nur fir WNDCLASSEX nicht fr die alte WNDCLASS
	if (!RegisterClassEx(&amp;windowClass))
		return 0; //BEKOMME beim erstellen eines 2 Fensters 0 Zurück!!!!

	/* ERSTELLEN DES FENSTERS */
	m_hwnd = CreateWindowEx(NULL, 
		&quot;Meine Klasse!&quot;, 
		&quot;Avl Baum Opengl Ausgabe&quot;, 
		WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
		100, 100,		// xy Koordinaten
		400, 400,		// h�e, breite
		NULL,			// Anhaltspunkt to parent
		NULL,			// Anhaltspunkt zum menue
		hInstance,		// applikations instance
		NULL);			// keine extra parameter

	/* wurde Fenster ohne Probleme erstellt */
	if (!m_hwnd)
		return 0;

	done = false;

	/* Message Loop und rendering */
	while (GetMessage(&amp;msg,m_hwnd,0,0)) {

		TranslateMessage(&amp;msg); // bersetze msg
		DispatchMessage(&amp;msg);  // msg abfertigen und Windows schicke

		render();
	}

	return msg.wParam;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/669996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/669996</guid><dc:creator><![CDATA[spjoe_awn]]></dc:creator><pubDate>Thu, 09 Dec 2004 21:21:42 GMT</pubDate></item></channel></rss>