WMPlayer Dll Import Question
-
Hello, i am on a little player project in C# i like to give it away for some friends but without this wmp.dll i would just like to give the *.exe and refer to the already existing dll in system32 folder any idea maybe how to can do that? it works all fine if i import it over the visual studio references (right mouseclick, add..) but than it have to be next to the *.exe file when i wanna start the prog please give advise Regards, Sep
-
Hello, i am on a little player project in C# i like to give it away for some friends but without this wmp.dll i would just like to give the *.exe and refer to the already existing dll in system32 folder any idea maybe how to can do that? it works all fine if i import it over the visual studio references (right mouseclick, add..) but than it have to be next to the *.exe file when i wanna start the prog please give advise Regards, Sep
Under normal circumates the dll is loaded from System32 folder unless it is present in the same folder as exe. Since i do not know if this dll is managed or unmanaged or COM dll. You can attempt to register dll. http://social.msdn.microsoft.com/Forums/en-AU/netfx64bit/thread/813f13ec-0180-496a-8af0-b57dfd4e4de4[^] If it is managed dll, maybe you can consider putting it as GAC (Global Assembly Cache) Edit: If you have 64bit os, for 32 bit process put in SysWOW64, for 64 bit process put in system32
-
Under normal circumates the dll is loaded from System32 folder unless it is present in the same folder as exe. Since i do not know if this dll is managed or unmanaged or COM dll. You can attempt to register dll. http://social.msdn.microsoft.com/Forums/en-AU/netfx64bit/thread/813f13ec-0180-496a-8af0-b57dfd4e4de4[^] If it is managed dll, maybe you can consider putting it as GAC (Global Assembly Cache) Edit: If you have 64bit os, for 32 bit process put in SysWOW64, for 64 bit process put in system32
hm bit confusing its not my dll its COM i just saw its located in system32 folder but when i move my exe out of the project folder it wont start with out this dll, i was just trying to DllImport()... but i cant read the classes then so it wont let me compil.. btw how and where can i put it as GAC? regards
-
hm bit confusing its not my dll its COM i just saw its located in system32 folder but when i move my exe out of the project folder it wont start with out this dll, i was just trying to DllImport()... but i cant read the classes then so it wont let me compil.. btw how and where can i put it as GAC? regards
I don't know the entire answer, however this much I can tell you: 1. wmp.dll contains native code, hence it can't go into the GAC. Either it holds COM components (which I don't know much about), or it requires P/Invoke to call individual functions (which I have descibed to some length here[^]). And I do expect it to be COM. 2. If you use P/Invoke (which also means you don't "Add Reference"), the DLL is located in the good old way, in the exe's folder first, then through the system environment variable "PATH", which typically contains
C:\Windows\system32\
and many others. The app will start even when the DLL isn't present, however every reference to it will obviously fail during app execution. 3. OTOH, if you have a hard reference to a DLL (as with "Add Reference"), then the DLL file (and its dependencies) must be present for the app to load successfully. 4. I'm pretty sure there are several CP articles that refer to wmp.dll, so you could go and have a look how they handle things. :)Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Hello, i am on a little player project in C# i like to give it away for some friends but without this wmp.dll i would just like to give the *.exe and refer to the already existing dll in system32 folder any idea maybe how to can do that? it works all fine if i import it over the visual studio references (right mouseclick, add..) but than it have to be next to the *.exe file when i wanna start the prog please give advise Regards, Sep