<?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[Warum wirft MSVC++ eine Zugriffsverletzung?]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe es hier reingetan, weil ich im Prinzip keine spezielle Frage bezüglich GTKmm ist, sondern die Funktion nutzt ist Windows spezifisch.<br />
ich habe eine Frage, aber erstmal der Quellcode:</p>
<p>structs.h</p>
<pre><code>#ifndef _STRUCTS_H_
#define _STRUCTS_H_

	struct _HWProps 
	{
		enum _port{
			SERIAL,
			PS2_KEYBOARD,
			PS2_MOUSE,
			USB
		} port;
		Glib::ustring COMp;

	};

	enum _PORTS
	{
		USB,
		SERIAL,
		PS2
	};

#endif
</code></pre>
<p>hw_props.hpp</p>
<pre><code>#ifndef _HW_PROPS_HPP_
#define _HW_PROPS_HPP_

#include&lt;gtkmm.h&gt;
#include&quot;structs.h&quot;
#include&lt;Windows.h&gt;
#include&lt;string&gt;
#include&lt;vector&gt;
#include&lt;map&gt;

class HPDialog : public Gtk::Dialog
{
private:
	_HWProps me;
	//Gtk::ComboBox pcb;
	//Gtk::ComboBox fcb;
	Gtk::Label labels[4];
	Gtk::ComboBoxEntryText pcbt;
	Gtk::ComboBoxEntryText fcb;
	std::map&lt;Glib::ustring,Glib::ustring&gt; fcontent;
protected:
	bool populate_cd();
	DWORD getHID(_PORTS);
public:
	HPDialog(_HWProps);
	~HPDialog(){}
	void on_cbPort_click();
};

#endif
</code></pre>
<p>hw_props.cpp</p>
<pre><code>#include&quot;hw_props.hpp&quot;
#include&lt;iostream&gt;
#include&lt;WinUser.h&gt;

HPDialog::HPDialog(_HWProps in)
{
	this-&gt;me = in;
	this-&gt;labels[0].set_label(&quot;Select Your Connection Mode&quot;);
	this-&gt;get_vbox()-&gt;add(this-&gt;labels[0]);
	this-&gt;pcbt.append_text(&quot;USB&quot;);
	this-&gt;pcbt.append_text(&quot;SERIAL&quot;);
	this-&gt;pcbt.append_text(&quot;PS/2&quot;);
	this-&gt;pcbt.signal_changed().connect(sigc::mem_fun(*this,&amp;HPDialog::on_cbPort_click));
	this-&gt;get_vbox()-&gt;add(this-&gt;pcbt);
	this-&gt;show_all_children();

}

void HPDialog::on_cbPort_click()
{
	Glib::ustring t = this-&gt;pcbt.get_active_text();
	std::cout&lt;&lt;t.c_str()&lt;&lt;std::endl;
	if(t==&quot;USB&quot;)
		if(this-&gt;getHID(_PORTS::USB)!=0) //hier wirft er die Ausnahme raus.
			std::cout&lt;&lt;&quot;ERROR&quot;&lt;&lt;std::endl;

	if(t==&quot;SERIAL&quot;)
		if(this-&gt;getHID(_PORTS::SERIAL)!=0)
			std::cout&lt;&lt;&quot;ERROR&quot;&lt;&lt;std::endl;
	if(t==&quot;PS/2&quot;)
		if(this-&gt;getHID(_PORTS::PS2)!=0)
			std::cout&lt;&lt;&quot;ERROR&quot;&lt;&lt;std::endl;
	if(this-&gt;fcontent.empty())
		std::cout&lt;&lt;&quot;CONTENT EMPTY&quot;&lt;&lt;std::endl;

}

DWORD HPDialog::getHID(_PORTS p)
{
	switch(p)
	{
	case _PORTS::USB:
		RAWINPUTDEVICELIST *tmp;
		UINT res = GetRawInputDeviceList(tmp,NULL,sizeof(tmp));
		for (unsigned short i = 0; i&lt;res;i++)
		{
			TCHAR name[99];
			UINT cbSize = sizeof(name);
			if(GetRawInputDeviceInfo(tmp[i].hDevice,RIDI_DEVICENAME,name,&amp;cbSize)&gt;-1)
			{
				std::wcout&lt;&lt;name&lt;&lt;std::endl;
			}
		}
		break;

	}
	return 0;
}
</code></pre>
<p>die anderen Codeschnippsel sind hier<br />
<a href="http://nopaste.info/b2531f0069.html" rel="nofollow">http://nopaste.info/b2531f0069.html</a></p>
<p>Fehlermeldung</p>
<pre><code>Unbehandelte Ausnahme bei 0x000000013F76192D in ROSPOS.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x0000000000000012
</code></pre>
<p>Wer kann mir helfen?</p>
<p>Es soll ein POS Programm sein.</p>
<p>Mit freundlichen Grüßen<br />
Sepultura</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/323862/warum-wirft-msvc-eine-zugriffsverletzung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 10:51:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/323862.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Feb 2014 08:52:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Warum wirft MSVC++ eine Zugriffsverletzung? on Thu, 20 Feb 2014 08:52:58 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe es hier reingetan, weil ich im Prinzip keine spezielle Frage bezüglich GTKmm ist, sondern die Funktion nutzt ist Windows spezifisch.<br />
ich habe eine Frage, aber erstmal der Quellcode:</p>
<p>structs.h</p>
<pre><code>#ifndef _STRUCTS_H_
#define _STRUCTS_H_

	struct _HWProps 
	{
		enum _port{
			SERIAL,
			PS2_KEYBOARD,
			PS2_MOUSE,
			USB
		} port;
		Glib::ustring COMp;

	};

	enum _PORTS
	{
		USB,
		SERIAL,
		PS2
	};

#endif
</code></pre>
<p>hw_props.hpp</p>
<pre><code>#ifndef _HW_PROPS_HPP_
#define _HW_PROPS_HPP_

#include&lt;gtkmm.h&gt;
#include&quot;structs.h&quot;
#include&lt;Windows.h&gt;
#include&lt;string&gt;
#include&lt;vector&gt;
#include&lt;map&gt;

class HPDialog : public Gtk::Dialog
{
private:
	_HWProps me;
	//Gtk::ComboBox pcb;
	//Gtk::ComboBox fcb;
	Gtk::Label labels[4];
	Gtk::ComboBoxEntryText pcbt;
	Gtk::ComboBoxEntryText fcb;
	std::map&lt;Glib::ustring,Glib::ustring&gt; fcontent;
protected:
	bool populate_cd();
	DWORD getHID(_PORTS);
public:
	HPDialog(_HWProps);
	~HPDialog(){}
	void on_cbPort_click();
};

#endif
</code></pre>
<p>hw_props.cpp</p>
<pre><code>#include&quot;hw_props.hpp&quot;
#include&lt;iostream&gt;
#include&lt;WinUser.h&gt;

HPDialog::HPDialog(_HWProps in)
{
	this-&gt;me = in;
	this-&gt;labels[0].set_label(&quot;Select Your Connection Mode&quot;);
	this-&gt;get_vbox()-&gt;add(this-&gt;labels[0]);
	this-&gt;pcbt.append_text(&quot;USB&quot;);
	this-&gt;pcbt.append_text(&quot;SERIAL&quot;);
	this-&gt;pcbt.append_text(&quot;PS/2&quot;);
	this-&gt;pcbt.signal_changed().connect(sigc::mem_fun(*this,&amp;HPDialog::on_cbPort_click));
	this-&gt;get_vbox()-&gt;add(this-&gt;pcbt);
	this-&gt;show_all_children();

}

void HPDialog::on_cbPort_click()
{
	Glib::ustring t = this-&gt;pcbt.get_active_text();
	std::cout&lt;&lt;t.c_str()&lt;&lt;std::endl;
	if(t==&quot;USB&quot;)
		if(this-&gt;getHID(_PORTS::USB)!=0) //hier wirft er die Ausnahme raus.
			std::cout&lt;&lt;&quot;ERROR&quot;&lt;&lt;std::endl;

	if(t==&quot;SERIAL&quot;)
		if(this-&gt;getHID(_PORTS::SERIAL)!=0)
			std::cout&lt;&lt;&quot;ERROR&quot;&lt;&lt;std::endl;
	if(t==&quot;PS/2&quot;)
		if(this-&gt;getHID(_PORTS::PS2)!=0)
			std::cout&lt;&lt;&quot;ERROR&quot;&lt;&lt;std::endl;
	if(this-&gt;fcontent.empty())
		std::cout&lt;&lt;&quot;CONTENT EMPTY&quot;&lt;&lt;std::endl;

}

DWORD HPDialog::getHID(_PORTS p)
{
	switch(p)
	{
	case _PORTS::USB:
		RAWINPUTDEVICELIST *tmp;
		UINT res = GetRawInputDeviceList(tmp,NULL,sizeof(tmp));
		for (unsigned short i = 0; i&lt;res;i++)
		{
			TCHAR name[99];
			UINT cbSize = sizeof(name);
			if(GetRawInputDeviceInfo(tmp[i].hDevice,RIDI_DEVICENAME,name,&amp;cbSize)&gt;-1)
			{
				std::wcout&lt;&lt;name&lt;&lt;std::endl;
			}
		}
		break;

	}
	return 0;
}
</code></pre>
<p>die anderen Codeschnippsel sind hier<br />
<a href="http://nopaste.info/b2531f0069.html" rel="nofollow">http://nopaste.info/b2531f0069.html</a></p>
<p>Fehlermeldung</p>
<pre><code>Unbehandelte Ausnahme bei 0x000000013F76192D in ROSPOS.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x0000000000000012
</code></pre>
<p>Wer kann mir helfen?</p>
<p>Es soll ein POS Programm sein.</p>
<p>Mit freundlichen Grüßen<br />
Sepultura</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384209</guid><dc:creator><![CDATA[Sepultura]]></dc:creator><pubDate>Thu, 20 Feb 2014 08:52:58 GMT</pubDate></item><item><title><![CDATA[Reply to Warum wirft MSVC++ eine Zugriffsverletzung? on Thu, 20 Feb 2014 08:54:14 GMT]]></title><description><![CDATA[<p>Debugger anwerfen und gucken, wo der unerwartete (ungeprüfte?) Nullzeiger herkommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384210</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Thu, 20 Feb 2014 08:54:14 GMT</pubDate></item><item><title><![CDATA[Reply to Warum wirft MSVC++ eine Zugriffsverletzung? on Thu, 20 Feb 2014 09:05:05 GMT]]></title><description><![CDATA[<p>Sepultura schrieb:</p>
<blockquote>
<pre><code class="language-cpp">DWORD HPDialog::getHID(_PORTS p)
{
	switch(p)
	{
	case _PORTS::USB:
		RAWINPUTDEVICELIST *tmp;
		UINT res = GetRawInputDeviceList(tmp,NULL,sizeof(tmp));
		for (unsigned short i = 0; i&lt;res;i++)
		{
			TCHAR name[99];
			UINT cbSize = sizeof(name);
			if(GetRawInputDeviceInfo(tmp[i].hDevice,RIDI_DEVICENAME,name,&amp;cbSize)&gt;-1)
			{
				std::wcout&lt;&lt;name&lt;&lt;std::endl;
			}
		}
		break;
	
	}
	return 0;
}
</code></pre>
</blockquote>
<p>Das gesamte Handling der RAWINPUTDEVICELIST kommt wir etwas spanisch vor - schau dir noch mal die Doku dazu an - am besten auch ein <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms645598%28v=vs.85%29.aspx" rel="nofollow">Beispiel</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384212</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384212</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Thu, 20 Feb 2014 09:05:05 GMT</pubDate></item><item><title><![CDATA[Reply to Warum wirft MSVC++ eine Zugriffsverletzung? on Thu, 20 Feb 2014 10:43:31 GMT]]></title><description><![CDATA[<p>danke, habe es korrigiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384225</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384225</guid><dc:creator><![CDATA[Sepultura]]></dc:creator><pubDate>Thu, 20 Feb 2014 10:43:31 GMT</pubDate></item></channel></rss>