cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Archicad crashs: Windows has triggered a breakpoint in AC

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

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!