How to make dll referenced by ActiveX component accessible?
        Posted  
        
            by sherpa
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by sherpa
        
        
        
        Published on 2010-05-22T21:18:26Z
        Indexed on 
            2010/05/22
            21:20 UTC
        
        
        Read the original article
        Hit count: 181
        
I have an ActiveX component developed in C#. I'm referencing a dll which comes with other native dlls and it is loading them on the fly expecting them to be in the same folder (probably using Assembly.GetExecutingAssembly().Location but not sure, I don't have control over them). There is also one ini file which is also expected to be in the same folder. 
When I run the application as Windows form app, everything is fine, of course. But the trouble comes when I run it within Internet Explorer as the base directory is at the location of iexplore.exe. Obviously neither the dlls or the ini file can be found and many temporary working files outputted by the dlls are located in Internet Explorer folder. 
The workaround is to copy all ddls and ini file into the ie folder but that is not something I'd be happy about. What is the proper solution to this? Can I somehow set the base path for the ActiveX component?
© Stack Overflow or respective owner