cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Archicad C++ API
About Archicad add-on development using the C++ API.

Archicad crashs: Windows has triggered a breakpoint in AC

Anonymous
Not applicable
Hello

I call and get a class from dll in my add-on code.
Archicad crashs when I remove the instance by the following code
::FreeLibrary(dynamicLib);
It seems AC can't delete instance of the dll.

Here is my code
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(&webAPICommand, "issues");
		}
		
		webAPICommand->run("", "", issues);

		::FreeLibrary(dynamicLib);


And here is the error

Windows has triggered a breakpoint in ArchiCAD.exe.
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.
This may also be due to the user pressing F12 while ArchiCAD.exe has focus.
The output window may have more diagnostic information.

Thanks in advance!
0 REPLIES 0