本文介绍了从C#.Net 2010开始推出VB6功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从C#PInvoke用VB6编写的函数。调用DLL的VB6代码声明如下:

I want to PInvoke a function written in VB6 from C#. The VB6 code that calls the DLL is declared like this:

Declare Function ApplyNNet Lib " location of the DLL file" (MyNNetType As String, MyAddress As String, MyInput() As Double) As Variant





My C#版本如下所示: *



My C# version looks like this:*

[DllImport("NNetApply.dll")]
public static extern object ApplyNNet(string type, string add, double[] data);



我这样称呼函数:


I call the function like this:

object P_ = ApplyNNet("Back Prop", address,data);



使用此声明我收到PInvoke错误:


With this declaration I receive a PInvoke error:

PInvoke restriction: cannot return variants.

推荐答案


这篇关于从C#.Net 2010开始推出VB6功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 20:51
查看更多