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

Loading DLL from AddOn fails for ArchiCAD27

Martin Walter

I have working code for an ArchiCAD-Addon for Versions 22-26. Now I try to run it with ArchiCAD 27 but it fails in the following line:



m_hModule = ::LoadLibrary(wstrDLLPath);



LoadLibrary() returns 0.


I investigated, that ::GetLastError(); returns 127, that means a Procedure is not found.

This does not make much sense in the ::LoadLibrary function.


Maybe it is the 


BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved);



function that is missing in my DLL. Or did I miss something else?


AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
Akos Somorjai

Hi Martin,


Couple of questions:
Is this your own DLL?
Is it on a path accessible by Archicad?
Can you load it if you place the DLL beside Archicad 27?


Best, Akos


I found my mistake: It is my own DLL and it includes some ArchiCAD API functions. I compiled and linked it against the ArchiCAD 26 API and tried to load the DLL with ArchiCAD 27.

AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD

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!