<?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 Archicad crashs: Windows has triggered a breakpoint in AC in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Archicad-crashs-Windows-has-triggered-a-breakpoint-in-AC/m-p/241285#M5413</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I call and get a class from dll in my add-on code.&lt;BR /&gt;Archicad crashs when I remove the instance by the following code
&lt;PRE&gt;::FreeLibrary(dynamicLib);&lt;/PRE&gt;
It seems AC can't delete instance of the dll.&lt;BR /&gt;&lt;BR /&gt;Here is my code&lt;BR /&gt;
&lt;PRE&gt;IBCObject * webAPICommand = NULL;
		typedef void(*createCommand)(IBCObject**, const char *);

		LPCSTR dllName = "MyDll.dll";
		HINSTANCE dynamicLib = LoadLibrary(dllName);

		if (dynamicLib)
		{
			createCommand newCommand;
			newCommand = (createCommand)::GetProcAddress(dynamicLib, "getCommand");
			newCommand(&amp;amp;webAPICommand, "issues");
		}
		
		webAPICommand-&amp;gt;run("", "", issues);

		::FreeLibrary(dynamicLib);&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;And here is the error&lt;BR /&gt;&lt;BR /&gt;Windows has triggered a breakpoint in ArchiCAD.exe.&lt;BR /&gt;This may be due to a corruption of the heap, which indicates a bug in ArchiCAD.exe or any of the DLLs it has loaded.&lt;BR /&gt;This may also be due to the user pressing F12 while ArchiCAD.exe has focus.&lt;BR /&gt;The output window may have more diagnostic information.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 11:51:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-01T11:51:48Z</dc:date>
    <item>
      <title>Archicad crashs: Windows has triggered a breakpoint in AC</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Archicad-crashs-Windows-has-triggered-a-breakpoint-in-AC/m-p/241285#M5413</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I call and get a class from dll in my add-on code.&lt;BR /&gt;Archicad crashs when I remove the instance by the following code
&lt;PRE&gt;::FreeLibrary(dynamicLib);&lt;/PRE&gt;
It seems AC can't delete instance of the dll.&lt;BR /&gt;&lt;BR /&gt;Here is my code&lt;BR /&gt;
&lt;PRE&gt;IBCObject * webAPICommand = NULL;
		typedef void(*createCommand)(IBCObject**, const char *);

		LPCSTR dllName = "MyDll.dll";
		HINSTANCE dynamicLib = LoadLibrary(dllName);

		if (dynamicLib)
		{
			createCommand newCommand;
			newCommand = (createCommand)::GetProcAddress(dynamicLib, "getCommand");
			newCommand(&amp;amp;webAPICommand, "issues");
		}
		
		webAPICommand-&amp;gt;run("", "", issues);

		::FreeLibrary(dynamicLib);&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;And here is the error&lt;BR /&gt;&lt;BR /&gt;Windows has triggered a breakpoint in ArchiCAD.exe.&lt;BR /&gt;This may be due to a corruption of the heap, which indicates a bug in ArchiCAD.exe or any of the DLLs it has loaded.&lt;BR /&gt;This may also be due to the user pressing F12 while ArchiCAD.exe has focus.&lt;BR /&gt;The output window may have more diagnostic information.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:51:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Archicad-crashs-Windows-has-triggered-a-breakpoint-in-AC/m-p/241285#M5413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:51:48Z</dc:date>
    </item>
  </channel>
</rss>

