![](/img/trans.png)
[英]VS2008 WinForm project, error occured when run the project : 'The operation could not be completed. The process cannot access the file'
[英]Adding a wizard to a blank project: “The operation could not be completed. No such interface supported”
我创建了一个自定义向导,该向导通过代码为用户列出一些SQL查询的代码生成Windows窗体。 对于表单和向导本身的几乎所有测试,将其添加到空白项目中都会弹出表单,并且我可以测试按钮单击事件和其他常规表单内容。 最近,我充实了列表框的事件侦听器,从那时起,我得到此错误:
谷歌搜索使我获得了很多关于Ruby的帖子,而我没有使用过。 其他建议是重新启动并重新安装,但这些建议均未成功。 我试图注释掉列表框事件,但这并没有阻止错误发生,但是,如果有帮助,请考虑以下事件:
//-----------Event fired when a listbox object is double-clicked; populate the listbox with the new databases---------
public void dataList_MouseDoubleClick(object sender, EventArgs e)
{
//temp string used to hold the name of the clicked object
string selectedNAME = dataList.SelectedItem.ToString();
firstSEL.TableVar = selectedNAME;
foreach (tempDataVar t in dataVars)
{
if (t.TableVar == firstSEL.TableVar)
{
firstSEL = t;
}
}
string newQ = "SELECT COLUMN_NAME,* FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" + firstSEL.TableVar + "' AND TABLE_SCHEMA= '" + firstSEL.SchemaVar + "'";//order by TABLE_NAME'";
results = GetDataSet(bldr.ToString(), newQ);
//listBox1.Items.Clear();
foreach (DataRow row in results.Tables[0].Rows)
{
//foreach (object x in row.ItemArray)
//{
// listBox1.Items.Add(x.ToString());
//}
for (int x = 0; x < row.ItemArray.Length; x++)
{
if (x == 0)
{
colList.Items.Add(row.ItemArray[x]);
}
}
}
dataList.Enabled = false;
}
//-----------------------------Event that fires when the index of the second listbox changes--------------------------
private void colList_SelectedIndexChanged(object sender, EventArgs e)
{
btnYes.Enabled = true;
}
同事纠正的Noobie错误! 我盲目地从“如何制作向导教程”中复制并粘贴了以下代码:
[ComVisible(true)]
[Guid("20184B81-7C38-4E02-A1E3-8D564EEC2D25"),
ProgId("MyNewWizard.Class1")]
这段代码必须直接位于MyNewWizard类的上方,而我不小心将这些行和MyNewWizard类的开头之间的空白处粘贴到我的自定义TempDataVar类中。 如果您收到类似的错误,则建议您按照一些属性/类的顺序进行测试!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.