Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5141

Re: Access to VO Function with Return Type ARRAY from C#

From Kai Michael Poppe <kmpams@gmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Access to VO Function with Return Type ARRAY from C#
Date 2013-04-24 14:22 +0000
Organization A noiseless patient Spider
Message-ID <kl8prf$ggu$1@dont-email.me> (permalink)
References <3bcf2b08-aae8-4c5b-a2dd-b015f4e03bcb@googlegroups.com> <eSQdt.93956$ZX4.54473@fx08.fr7>

Show all headers | View raw


Hi Malcom!

> if it works with strings I suspect you can get it to work, with great
> care. The in memory data structure of the VO array type is not that hard
> to reverse engineer, I would start by claiming the function returns an
> intptr and digging around from that. (The big worry would be the VO GC
> moving things but that can only happen when you are in VO code)

IntPtr was my second guess. I actually managed to have C# not throw any 
exceptions when using IntPtr, yet the returned values did not match 
anything I would expect...

Until I used Marshal.Copy ( IntPtr source, int[] dest, 0, 128 ) - the 
values that were actually returned started somewhere around array index 
15. I quite can't figure out why, but with a few more line of code I can 
solve my problem :)

Thanks for your suggestions!

Regards

Kai

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Access to VO Function with Return Type ARRAY from C# Kai Michael Poppe <kmpams@gmail.com> - 2013-04-24 05:10 -0700
  Re: Access to VO Function with Return Type ARRAY from C# "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-04-24 14:28 +0200
    Re: Access to VO Function with Return Type ARRAY from C# Kai Michael Poppe <kmpams@gmail.com> - 2013-04-24 06:02 -0700
  Re: Access to VO Function with Return Type ARRAY from C# Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2013-04-24 14:11 +0100
    Re: Access to VO Function with Return Type ARRAY from C# Kai Michael Poppe <kmpams@gmail.com> - 2013-04-24 14:22 +0000

csiph-web