I am trying to make slide show work with time interval, But show some errors I am using medialooks SDK components. But application show some errors.
System.ArgumentNullException
HResult=0x80004003
Message=Value cannot be null.
Parameter name: path
Source=mscorlib
StackTrace:
at System.IO.Directory.GetFiles(String path, String searchPattern)
at CGEditor_WinForms.MainWindow.button1_Click(Object sender, EventArgs e) in E:\test work\CGEditor_WinForms\MainWindow.cs:line 997
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at PlaylistSample.Form1.CgEditorButton_Click(Object sender, EventArgs e) in E:\test work\Playlist Sample\Form1.cs:line 295
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at PlaylistSample.Program.Main() in E:\test work\Playlist Sample\Program.cs:line 17
This exception was originally thrown at this call stack:
[External Code]
CGEditor_WinForms.MainWindow.button1_Click(object, System.EventArgs) in MainWindow.cs
[External Code]
PlaylistSample.Form1.CgEditorButton_Click(object, System.EventArgs) in Form1.cs
[External Code]
PlaylistSample.Program.Main() in Program.cs
What I have tried:
<pre lang="C#">
private void button1_Click(object sender, EventArgs e)
{
string imgslideID = "";
int imgslideposX = 50;
int imgslideposY = 50;
timer1.Interval = int.Parse(comboBox1.Text) * 1000;
timer1.Start();
if (m_strImagePath == null || m_strImagePath == string.Empty)
{
}
System.Windows.Forms.FolderBrowserDialog openFolder = new System.Windows.Forms.FolderBrowserDialog();
if (openFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
m_objEditor.CGObject.AddNewItem(openFolder.SelectedPath, imgslideposX, imgslideposY, 0, 1, ref imgslideID);
m_objEditor.UpdateItemsList();
string[] files = Directory.GetFiles(Dirpath, "*.Jpg");
Dirpath = openFolder.SelectedPath;
foreach (string file in files)
{
int pos = file.LastIndexOf("||");
string FName = file.Substring(pos + 1);
}
}
}