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

An unhandled exception was encountered during a user callbac

Not applicable

I call dll functions from my ac add-on.
Archicad crashs end of the code!

I get the following error
'Unhandled exception at 0x00007ff8eacc6a20 in ArchiCAD.exe: 0xC000041D: An unhandled exception was encountered during a user callback'

and here is my code
 if (e.GetSource() == &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<iklass_factory>(::GetProcAddress(dll_handle, "create_klass"));
		if (!factory_func) {

		IKlass* instance = factory_func();
		std::vector<int> info = instance->data(); //  This is what I need from dll and it works fine


I get data which I need but end of the code archicad crashs
The same code works in other projects so error occurs only when I try to run my code in archicad add-on
and mouse pointer goes to GSNew.hpp file on delete function

Thanks in advance!

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").

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!