I have a winapp with the wmPlayer in it which is using it's own dll's to actually function.
But, when i move my app in another folder that dont contains the 2 dll asociated with the player in it, my application freeze for 1min and auto closes by default.
I want a way to pop out a MessageBox with my custom error, to remind myself (user) about this little step; to add the dll's with the application inside same folder.
edited#1
My Compiled exe is having this issue. Not the VS project.
When i put it With the 2 dll's in the same folder, then all is fine, indiferent of the folder location on my hdd. The problem arise when i forget to move the dll's into application's folder.
My code is working fine. The problem is that the 'player' object is requesting those dll's when the form is initializing. I dont think it is even passing after InitializeComponent();
Check what ive tried:
I've tried with 2 threads.
I've tried with {try catch}.
No (good) results.
Thank you.
public Form1()
{
InitializeComponent();
di = new DirectoryInfo(path);
Thread thread1 = new Thread(new ThreadStart(A));
Thread thread2 = new Thread(new ThreadStart(B));
thread1.Start();
thread2.Start();
thread1.Join();
thread2.Join();
}
void A()
{
bool Interop = false;
bool AxInterop = false;
foreach (var file in di.GetFiles())
{
if (file.Name == "Interop.WMPLib.dll")
{
Interop = true;
}
if (file.Name == "AxInterop.WMPLib.dll")
{
AxInterop = true;
}
}
if (Interop & AxInterop) { }
else
{
MessageBox.Show("Error: Interop.WMPLib.dll or AxInterop.WMPLib.dll is missing to run this player.\r\n Please put the 2 dll with this application in the same folder.");
}
}
What I have tried:
I've tried with 2 threads.
I've tried with {try catch}.
No (good) results.