0

I have used the vlc.dll in my form. After installing this, if I install vlc outside this, my app starts using the dll from that folder. So, how can I force my app to use the dll from its own folder?

Sunny
  • 3
  • 4
  • 1
    Please change vlc.dll in the title and question to the correct name axvlc.dll so this question can be easier to find for anyone else with the same problem. – user1318499 May 01 '16 at 10:57

1 Answers1

1

If it's a native dll, Windows searches the application's own folder first. Dynamic-Link Library Search Order on msdn. It sounds like this is not happening, so ..

EDIT: For an ActiveX dll, you can use Registration-Free COM to tell your application to use a local version instead of the registered one.

if it's a managed dll, Windows searches the GAC first In what order are locations searched to load referenced DLLs?, which sounds like what you're experiencing.

You may need to rename the file so it appears to be different.

Do you have a good reason for using a private copy? By doing that, you won't benefit from security updates.

Community
  • 1
  • 1
user1318499
  • 1,327
  • 11
  • 33
  • It doesn't support a different version and shows an error. That's why I need to use the only version that I have used in my app. – Sunny Mar 30 '16 at 09:22
  • Only renaming the file is not working. I have changed the filename and then installed it using regsvr32. But VisualStudio is still identifying if I install VLC in a different location. – Sunny Apr 01 '16 at 06:30
  • Registering is for COM dlls. Are you sure you need to register it? Can you confirm if it's a native or managed dll? Or link to where it came from. All I found on Google was libvlc.dll, no vlc.dll. – user1318499 Apr 02 '16 at 00:58
  • It comes with the vlc player application, the name of the file is axvlc.dll, yes, it is a COM dll, it is an activex dll It also has dependencies, those files and folders are required to be placed in the same folder. – Sunny Apr 02 '16 at 07:01
  • I found somewhere that there are 2 types of dll. For one kind of dll, apps first look into the folder where it is installed; for another type, apps look into the GAC first, I guess it is of the 2nd type. Maybe you can suggest now, how to solve it in such case. – Sunny Apr 02 '16 at 07:10
  • The GAC is a newer thing for managed dlls. I don't think you can put COM/ActiveX dlls in there. COM/ActiveX dlls use the registry or their application's own folder to find them. So I'm surprised it's not working. – user1318499 Apr 03 '16 at 02:15
  • Thanks for the help. :) – Sunny Apr 03 '16 at 16:16