<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic An unhandled exception was encountered during a user callbac in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/An-unhandled-exception-was-encountered-during-a-user-callbac/m-p/239959#M5411</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I call dll functions from my ac add-on.&lt;BR /&gt;Archicad crashs end of the code!&lt;BR /&gt;&lt;BR /&gt;I get the following error &lt;BR /&gt;'Unhandled exception at 0x00007ff8eacc6a20 in ArchiCAD.exe: 0xC000041D: An unhandled exception was encountered during a user callback'&lt;BR /&gt;&lt;BR /&gt;and here is my code&lt;BR /&gt;
&lt;PRE&gt; if (e.GetSource() == &amp;amp;m_btnTest) {
		
		typedef IKlass* (__cdecl *iklass_factory)();

		HINSTANCE dll_handle = ::LoadLibrary(TEXT("BCWebSDK.dll"));
		if (!dll_handle) {
		}

		// Get the function from the DLL
		iklass_factory factory_func = reinterpret_cast&amp;lt;iklass_factory&amp;gt;(::GetProcAddress(dll_handle, "create_klass"));
		if (!factory_func) {
			::FreeLibrary(dll_handle);
		}

		IKlass* instance = factory_func();
		std::vector&amp;lt;int&amp;gt; info = instance-&amp;gt;data(); //  This is what I need from dll and it works fine
		instance-&amp;gt;destroy();
		::FreeLibrary(dll_handle);

	}&lt;/PRE&gt;
&lt;BR /&gt;I get data which I need but end of the code archicad crashs&lt;BR /&gt;The same code works in other projects so error occurs only when I try to run my code in archicad add-on&lt;BR /&gt;and mouse pointer goes to GSNew.hpp file on delete function&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 11:52:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-01T11:52:19Z</dc:date>
    <item>
      <title>An unhandled exception was encountered during a user callbac</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/An-unhandled-exception-was-encountered-during-a-user-callbac/m-p/239959#M5411</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I call dll functions from my ac add-on.&lt;BR /&gt;Archicad crashs end of the code!&lt;BR /&gt;&lt;BR /&gt;I get the following error &lt;BR /&gt;'Unhandled exception at 0x00007ff8eacc6a20 in ArchiCAD.exe: 0xC000041D: An unhandled exception was encountered during a user callback'&lt;BR /&gt;&lt;BR /&gt;and here is my code&lt;BR /&gt;
&lt;PRE&gt; if (e.GetSource() == &amp;amp;m_btnTest) {
		
		typedef IKlass* (__cdecl *iklass_factory)();

		HINSTANCE dll_handle = ::LoadLibrary(TEXT("BCWebSDK.dll"));
		if (!dll_handle) {
		}

		// Get the function from the DLL
		iklass_factory factory_func = reinterpret_cast&amp;lt;iklass_factory&amp;gt;(::GetProcAddress(dll_handle, "create_klass"));
		if (!factory_func) {
			::FreeLibrary(dll_handle);
		}

		IKlass* instance = factory_func();
		std::vector&amp;lt;int&amp;gt; info = instance-&amp;gt;data(); //  This is what I need from dll and it works fine
		instance-&amp;gt;destroy();
		::FreeLibrary(dll_handle);

	}&lt;/PRE&gt;
&lt;BR /&gt;I get data which I need but end of the code archicad crashs&lt;BR /&gt;The same code works in other projects so error occurs only when I try to run my code in archicad add-on&lt;BR /&gt;and mouse pointer goes to GSNew.hpp file on delete function&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:52:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/An-unhandled-exception-was-encountered-during-a-user-callbac/m-p/239959#M5411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: An unhandled exception was encountered during a user callbac</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/An-unhandled-exception-was-encountered-during-a-user-callbac/m-p/371813#M5412</link>
      <description>&lt;P&gt;Hi! Were you able to fix this error? I'm getting the same exception when using libcpr (DLLss are in Archicad.exe folder, and LIBs are properly linked at "Aditional Dependencies").&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 20:47:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/An-unhandled-exception-was-encountered-during-a-user-callbac/m-p/371813#M5412</guid>
      <dc:creator>BrunoValads</dc:creator>
      <dc:date>2023-02-28T20:47:21Z</dc:date>
    </item>
  </channel>
</rss>

