由于无效的返回类型或参数类型,未发出VB方法 [英] VB method not emitted because of invalid return type or parameter type

查看:133
本文介绍了由于无效的返回类型或参数类型,未发出VB方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到错误:当我制作一个VB6 DLL并在VC ++中使用该DLL时,由于无效的返回类型或参数类型而未发出方法'PolCoefCalc'.

我们的VB6源代码如下:

I get the error: method ''PolCoefCalc'' not emitted because of invalid return type or parameter type when I make a VB6 DLL and use the DLL in VC++.

Our VB6 source code is as following:

Dim xArray(60) as double
Dim YArray(60) as double
Public Function PolCoefCalc(ByRef pT() As Double, ByRef pU() As Double, ByRef pA() As Double) As Double
Dim resultA As Double
''1 pT=y copy this array elements to our internal array i.e. yArray
DataPoint = pN
''for insert data of ''pT'' array from->to ''Yarray''
For i = 0 To DataPoint
Yarray(i) = pT(i)
Next i
''for insert data of ''pU'' array from->to ''Xarray''
For i = 0 To DataPoint
Xarray(i) = pU(i)
Next i
''finally copy the result in pA array
For i = 1 To DataPoint
pA(i - 1) = xarray(i)
Next i
resultA = 0
PolCoefCalc = resultA
End Function



请提供解决方案,您能否解释为什么VC ++不显示"PolCoefCalc"方法,而是显示错误消息.



Kindly provide the solution and could you explain why VC++ does not show the ''PolCoefCalc'' method and instead shows the error message.

推荐答案

VB6 数组与 C/C ++ 数组不同:


    VB 中的
    • Double数组被视为对象,他们知道它们的大小,并且已经过边界检查 >
VB6 arrays are different from C/C++ arrays:


    • in VB an array of Double is treated as an object, they knows their size, and they are bounds checked
  • 数组double只是一个存储区,其大小正确,需要存储声明的数量并可以通过指针访问.运行时不跟踪数组大小,程序员有责任避免缓冲区溢出
  • in C/C++ an array of double is just a memory area with the right size required to store as many numbers as declared, and accessed by pointer. The runtime does not keep trace of the array size, and it''s responsibility of the programmer to avoid buffer overruns


这篇关于由于无效的返回类型或参数类型,未发出VB方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆