.NET Reference parameters

3 messages Options
Embed this post
Permalink
aschatte

.NET Reference parameters

Reply Threaded More More options
Print post
Permalink
How do I get the data associated with Reference or out parameters?  I have a DLL that uses these parameters liberally to reference data from within the DLL to the calling object.  It is used to control hardware that I am using and I would like to control it from an Eiffel object.

Peter Gummer-2

Re: .NET Reference parameters

Reply Threaded More More options
Print post
Permalink
aschatte wrote:

> How do I get the data associated with Reference or out parameters?  
> I have a DLL that uses these parameters liberally to reference data  
> from within the DLL to the calling object.  It is used to control  
> hardware that I am using and I would like to control it from an  
> Eiffel object.


According to:

http://docs.eiffel.com/book/platform-specifics/eiffel-net-limitations

"Eiffel does not have the notion of `byref' argument passing. At the  
moment, Eiffel for .NET cannot call nor can it redefine a feature that  
has a byref argument."

The Eiffel .NET documentation looks very dated, however. That  
particular page mentions EiffelStudio 5.5, and on another page I saw a  
comment that .NET does not support generics, which isn't true. .NET  
2.0 and higher has generics. So hopefully the limitation that I quoted  
above is no longer true either.

- Peter Gummer
aschatte

Re: .NET Reference parameters

Reply Threaded More More options
Print post
Permalink
--- In [hidden email], Peter Gummer <p-gummer@...> wrote:

>
> aschatte wrote:
>
> > How do I get the data associated with Reference or out parameters?  
> > I have a DLL that uses these parameters liberally to reference data  
> > from within the DLL to the calling object.  It is used to control  
> > hardware that I am using and I would like to control it from an  
> > Eiffel object.
>
>
> According to:
>
> http://docs.eiffel.com/book/platform-specifics/eiffel-net-limitations
>
> "Eiffel does not have the notion of `byref' argument passing. At the  
> moment, Eiffel for .NET cannot call nor can it redefine a feature that  
> has a byref argument."
>
> The Eiffel .NET documentation looks very dated, however. That  
> particular page mentions EiffelStudio 5.5, and on another page I saw a  
> comment that .NET does not support generics, which isn't true. .NET  
> 2.0 and higher has generics. So hopefully the limitation that I quoted  
> above is no longer true either.
>
> - Peter Gummer
>

Thanks for the info, Peter.  It would be good for me if Eiffel was able to work with 'byRef' parameters.  In my case, I am trying to use Eiffel to interface to an existing component that I do not have control over.

I tried to reference a DLL function with 'byRef' parameters and it recognized the function defined in the vendor documentation as:

PICkitS.DLL:
public static bool Get_PickitS_DLL_Version(ref string p_version)

 as:

PICkitS_Helper.e:
device.get_pickit_s_dll_version (p_version: TYPED_POINTER [detachable SYSTEM_STRING])

Is there a way to pull the ref string p_version data from the DLL using Eiffel?

Regarding this DLL, this is only the beginning as many other functions use 'byRef' parameters to pass the data.  How can I get the data out of this DLL using Eiffel?

It appears that Eiffel at least begins to recognize the 'byRef' parameter as a TYPED_POINTER.  I don't know how to use this type or how to de-reference it.

Thanks for your help.