My custom VisSim DLL I wrote gives "error 126 in LoadLibrary" on some computers

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Submitted by Joe on Tue, 11/03/2009 - 05:36 

 

I am just putting finishing touches our next simulator tool.

We continue to run into a persistent error (error 126) which shows up each time we want to show the model using VisSim Viewer (V7.35A) on a new computer. The dll is linked within VisSim in the Edit > Preferences > Add-on tab, but when the VisSim is loaded I get the error. We are not sure why it is happening. Each time I try to load VisSim this error shows up (on certain computers) It seems that the dll is missing files or ‘something else’ which need to be contained to work with the viewer.

  1. Can you provide all the correct compiler settings to ensure the dll works with VisSim Viewer.
  2. The dll is also being developed using VisSim 6.0 environment. Could this make a different?

Thank you in advance

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by Richd on Tue, 11/03/2009 - 05:45.

    Check your MSVC project settings to see if your build settings are correct. You likely have it set to 'Use MFC in shared DLL'. This requires that each computer that runs your DLL also have a special MFC DLL from Microsoft. If you build your DLL 'statically', then the MFC functions will be linked into your DLL. It makes your DLL bigger, but you will no longer get the error 126 problem.

    This setting is found under Project > Settings > General tab. Switch to 'Use MFC in static library', rebuild and your new DLL should load just fine on all computers, not just your development machine.