• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 773
  • Last Modified:

Powerbuilder 11, calling VB6 DLL failing on array variable

I have a small VB 6 DLL that I'm creating to house a complex calculation already written in VB6.  I'm calling it from Powerbuilder 11.1.  I can get the two to interact successfully, passing doubles, returning doubles, doing bogus calculations within the VB DLL.  However, as soon as I incorporate an array variable in the VB code, Powerbuilder returns an error when trying to call the function.  



The actual calculations uses many array variables, some multi-dimensional, which it loops through for various computations.  

Why is this failing on the array variable?

'For example, this VB code works
 
Public Function GetValue(ByVal x as double, ByVal y as double) as double
Dim Z as double
 
GetValue=X+Y
 
End Function
'-------------------------------
'This VB code will fail when called from PB 11
 
Public Function GetValue(ByVal x as double, ByVal y as double) as double
Dim Z(1) as double
 
GetValue=X+Y
 
End Function
'-------------------------------

Open in new window

0
erika9star
Asked:
erika9star
  • 3
  • 2
1 Solution
 
EDDYKTCommented:
?

you have not use Z variable from anywhere
0
 
erika9starAuthor Commented:
True.  And yet it still causes a failure, even with only a declaration of the variable.  If I can't declare an array, I certainly can't use one.
0
 
EDDYKTCommented:
don't know much about Powerbuilder, do they use base 1 or base 0

if 1 then you may wan to add

Option Base 1

have you also tried

Dim Z() as double

redim Z(1)
0
 
erika9starAuthor Commented:
PB uses base 1.  

I have tried dim and redim.  No luck there either.

I've found that the VB "On Error Goto ... " Statements seem to be causing a function call failure as well.  It looks as if I'll be trying a different route.
0
 
erika9starAuthor Commented:
I'm rewriting the VB code into PowerBuilder.  Not my preferred solution, but it'll have to do.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now