title: ActiveX fails to load a library even if it is in the same location
body: <p>I am maintaining an ActiveX control developed in MFC to be used as a plug-in for a multiple of commercial applications.  This was all working perfectly until I wanted AES encryption included because the control needs to logon to a remote location automatically.  No big deal, created a C# class library (SimpleAES.dll) that only provides a class with 2 members, encrypt and decrypt.  Mixing managed and unmanaged code, I wrote a wrapper library in C++/CLR wrapping my encryption class (SimpleAESWrapper.dll).  </p>
  
  <p>This all works like a charm when tested using my ocx test container application, storing all 3 libraries in the same directory as the test container application (that is the test.exe together with ocx, together with the two dll's).  </p>
  
  <p>Unfortunately when I run a third party application, that loads the ocx, the ocx will not get loaded because it does crash as soon as I create an instance of the encryption class due to the fact that it cannot find the WrapperSimpleAES.dll. The third party application is ran from another location.  Adding the libraries location to the path or even system32 folder does not resolve the issue.</p>
  
  <p>Am I missing something crucial, like do the libraries have to be registered in some way like the ocx has to with regsvr32.exe? i.e. Applications know where to find the ocx because it is registered into the registry right?</p>
  
  <p>I have been pulling my hair out as I can nowhere find a useful lead.</p>