Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Type single

$
0
0
Re: Type single
Web Service Proxy Generator
Re: Type single
Apr. 9, 2013
03:23 pm
3RA0X041WShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Marcin
WWDOTNETBRIDGE.ZIP
Hi Marcin,

I'm not sure what the issue is - you should be able to pass a Single directly to .NET:

If I have a method like this:

public Single PassSingle(Single number) {return number + 10.2F; }

I can call it directly with:

? loNet.PassSingle(10)

So that works.

What doesn't work if you need to pass a Single as part of an InvokeMethod() call because FoxPro again can't cast to Single explicitly.

The following demonstrates this logic:

*** Passing Single - Single is supported in VFP and direct calls work *** but you can't cast it in InvokeMethod calls *** so ComValue is required *** Works ? loNet.PassSingle(10.2) *** This doesn't work as FoxPro can't cast to Single *? loBridge.InvokeMethod(loNet,"PassSingle",10.2) loComValue = loBridge.CreateComValue() loComValue.SetSingle(10.2) ? loBridge.InvokeMethod(loNet,"PassSingle",loComValue)

So... I added SetSingle() to ComValue now and that does make it work.

Updated .dll attached.

+++ Rick ---


Hi Rick,

Is type "single" provided by the method "CreateInstance" in DotNetBridge? I am trying to connect to Web Service where one of the input parameters is the structure with the field of type "Single". It seems that CreateInstance creates the structure with the field of type "Double", so I am getting the error "The parameter is incorrect". Am I right or I am doing something wrong? I did not find also the method SetSingle in ComValue. Is it any other way to set the value for single Float from FoxPro?
Marcin



Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web


Viewing all articles
Browse latest Browse all 10393

Trending Articles