Hi Everybody,
I am developing a windows application in XP machine.in my one form i have one text box for showing the selected file with path from openfiledialog box.and the other control is button to call the openfiledialog box.
When I cliked on the button to call the open dialog box I am getting the follwing error
--------------------------------------------------------------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7} failed due to the following error: 80040154.
at System.Windows.Forms.OpenFileDialog.CreateVistaDialog()
at System.Windows.Forms.FileDialog.RunDialogVista(IntPtr hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner)
at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
at System.Windows.Forms.CommonDialog.ShowDialog()
at iSAP2.GroundMaster.btnBrowse_Click(Object sender, EventArgs e) in GroundMaster.cs:line 974
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.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
--------------------------------------------------------------------------
Here is my code on button event
--------------------------------------------------------------------------
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openfiledialog = new OpenFileDialog()
openfiledialog.Filter = "xml files|*.xml"
openfiledialog.Multiselect = false
DialogResult dr
dr = openfiledialog.ShowDialog()
if (dr == DialogResult.OK)
{
txtgrdDataFile.Text = openfiledialog.FileName.ToString()
}
}
-----------------------------------------------------------------------------
rest of the form contains another controls like data grid and dropdowns.
Please help me to resolve this issue.
Thanx in advance.
Regards,
Sudarshan
[edit]"Ignore HTML..." option disabled - OriginalGriff[/edit]
[edit2] Added the lang attribute and closing PRE tag to it [/edit]