Addon fails to load with error code 193

  • wtesler
  • Topic Author
More
3 years 1 month ago #1 by wtesler Addon fails to load with error code 193 was created by wtesler
My addon fails to load when booting up the game. It gives error code 193. My addon is a basic addon which looks like:

#include <reshade.hpp>
#include <iostream>

using std::cout;
using std::endl;

using reshade::register_addon;
using reshade::unregister_addon;

extern "C" __declspec(dllexport) const char *NAME = "Frame Capture";
extern "C" __declspec(dllexport) const char *DESCRIPTION = "Capture Frames";

BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
if (!register_addon(hModule)) {
cout << "Failed to register addon." << endl;
return FALSE;
} else {
cout << "Registered addon" << endl;
}
break;
case DLL_PROCESS_DETACH:
cout << "Unregistering addon" << endl;
unregister_addon(hModule);
break;
default:
cout << "fdwReason = " << fdwReason << endl;
break;
}

return TRUE;
}


What is the failure?

 

Please Log in or Create an account to join the conversation.

  • wtesler
  • Topic Author
More
3 years 1 month ago #2 by wtesler Replied by wtesler on topic Addon fails to load with error code 193
I fixed the error by using Visual Studio throughout the build and toolchain. I was using the CLion IDE.

Please Log in or Create an account to join the conversation.

  • crosire
More
3 years 1 month ago #3 by crosire Replied by crosire on topic Addon fails to load with error code 193
Error codes 193 is ERROR_BAD_EXE_FORMAT (see docs.microsoft.com/en-us/windows/win32/d...-error-codes--0-499- ), which would indicate your previous buildchain just produced a broken DLL.

Please Log in or Create an account to join the conversation.