Passing Arrays to .NET (VB) Assembly and receive Values

Discussion forum about all things Team Developer 5.x and 6.x
klaushaidinger
Austria
Posts: 118
Joined: 13 Dec 2017, 06:08
Location: Austria

Passing Arrays to .NET (VB) Assembly and receive Values

Post by klaushaidinger » 17 Jun 2021, 04:59

Hi everyone.
I have to fill 3 String Arrays in an VB.NET Function, which is called by Gupta TD 6.2.

VB.NET:
Function f_GetPrograms(ByRef programid As String(), ByRef programname As String(), ByRef category As String()) As Integer

Gupta:
Set n_Count = myobject.f_GetPrograms ( program_id, program_name, program_category )
Gupta expects the parameters as Receive String [*]

When i call this, always the error "Der Wert darf nicht NULL sein. Parametername: types" occures.
But: there is no Parameter called "types".

I also made an testprogram in VB, that calls this function ... no Problem.
Does anyone have an idea, how to handle this?

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3384
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Passing Arrays to .NET (VB) Assembly and receive Values

Post by Dave Rabelink » 18 Jun 2021, 11:30

Are you using the GAIL (win32) interface or use it as COM?

It seems the function needs 3 strings as input and the TD declaration using an array is wrong.
Replace it with 3 input strings.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Return to “General Discussion”

Who is online

Users browsing this forum: [Ahrefs], [Ccbot] and 0 guests