用C#写的COM供C++调用,在不同的电脑上运行,有的正常,有的会报错,系统都是win7 32位。
报错信息如下:
System.Exception {System.Reflection.TargetException}
+ [System.Reflection.TargetException] {"Object does not match target type."} System.Reflection.TargetException
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
Message "Object does not match target type."
Source "mscorlib" string
StackTrace " at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)\r\n at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)\r\n at Client1.IOleTestEvents.OnNewData(Object NewData)\r\n at Client1.OleTest.NewData(String[] NewData) in d:\\source code\\Centurion\\Main\\Source\\Libraries\\OpenApps\\KicClient\\KicClient.cs:line 547"。求助!!!
报错信息如下:
System.Exception {System.Reflection.TargetException}
+ [System.Reflection.TargetException] {"Object does not match target type."} System.Reflection.TargetException
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
Message "Object does not match target type."
Source "mscorlib" string
StackTrace " at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)\r\n at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)\r\n at Client1.IOleTestEvents.OnNewData(Object NewData)\r\n at Client1.OleTest.NewData(String[] NewData) in d:\\source code\\Centurion\\Main\\Source\\Libraries\\OpenApps\\KicClient\\KicClient.cs:line 547"。求助!!!
解决方案 »
- <%#Eval("ID")%>能不能绑定后台方法
- 用.net开发软件时,如何连接非本地数据库?
- 一个简单的问题:怎样将textbox中输入的值传递到select语句中?
- 如何使用正则表达式将上面的换成下面的:<a href="bcs.asp?AL=HU&CC=Y">规定</a>
- asp.net C# 调用OCX 报错:“灾难性故障 (异常来自 HRESULT:0x8000FFFF (E_UNEXPECTED))”
- 字节转换
- 关于开源工具IReaper
- oledbdatareader的问题,急啊
- 高手们请教一个WINDOW 应用程序问题,
- 各位大大,追加送分了(在線等待)
- c#调用c++&opencv的dll,无法加载dll
- c# 不固定列的MVC处理
public void NewData(object NewData)
{
try
{
if (OnNewData != null)
{
OnNewData(NewData);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.Print(ex.ToString());
}
}NewData原本是string[],在传入委托函数前已经转成object。