LOCAL loNet as Westwind.WebConnection.TypePassingTests loNet = loBridge.Createinstance("Westwind.WebConnection.TypePassingTests") *** Pass parameters by Reference *** Create ComValue objects for each parameter loInt = loBridge.CreateComValue(INT(10)) loString = loBridge.CreateComValue("Hello World.") loDecimal = loBridge.CreateComValue(CAST( 5.22 as Currency)) ? "Original:" ? loInt.Value, loString.Value, loDecimal.Value lobridge.InvokeStaticMethod("Westwind.WebConnection.TypePassingTests",; "PassByReferenceStatic",; loInt,loString,loDecimal) *** Look at the result values ? "Updated:" ? loInt.Value, loString.Value, loDecimal.ValueThere are a also explicit methods that cast to types that FoxPro doesn't support:
loLong = loValue.SetLong(10)
loSingle = loValue.SetSingle(1.231)
loDbNull = loValue.SetDbNull()
which is why I tend to be explicit in the examples to make it clear that there's an object that has a number of operations you can perform on it to get around FoxPro's type limitations.>loNet = loBridge.Createinstance("Westwind.WebConnection.TypePassingTests") > >*** Create ComValue objects for each parameter >loInt = loBridge.CreateComValueInt(10) >loString = loBridge.CreateComValueString("Hello World.") >loDecimal = loBridge.CreateComValueCurrency(5.22) >>
>>loNet = loBridge.Createinstance("Westwind.WebConnection.TypePassingTests") >> >>*** Create ComValue objects for each parameter >>loInt = loBridge.CreateComValue() >>loInt.Value = INT(10) >>loString = loBridge.CreateComValue() >>loString.Value = "Hello World." >>loDecimal = loBridge.CreateComValue() >>loDecimal.Value = CAST( 5.22 as Currency) >> >>lobridge.InvokeStaticMethod("Westwind.WebConnection.TypePassingTests",; >> "PassByReferenceStatic",; >> loInt,loString,loDecimal) >> >>*** Look at the result values >>? loInt.Value, loString.Value, loDecimal.Value >>>>
>>>static public string VerifyAddress( ref string AddressLine1, ref string AddressLine2, ref string City, ref string State, ref string ZipCode, ref string Country)>>>
>>>lcResult = loBridge.Invokestaticmethod("Siriusware.Library.Cass", "VerifyAddress", @Address1, @Address2, @City, @State, @Zipcode, @Country) >>> ?Address1 >>> ?ZipCode >>> >>> ?lcResult >>>>>>
>>>>>do wwDotNetBridge >>>>>local loBridge as wwDotNetBridge >>>>>loBridge = createobject("wwDotNetBridge", 'V4') >>>>>if vartype(loBridge) = 'O' >>>>> if loBridge.LoadAssembly("Siriusware.Library.dll") >>>>> >>>>> Address1 = "2170 S Josephine St Unit 1" >>>>> Address2 = "" >>>>> City = "Denver" >>>>> State = "CO" >>>>> Zipcode = "80210" >>>>> Country = "USA" >>>>> >>>>> * string sResult = Cass.VerifyAddress( ref Address1, ref Address2, ref City, ref State, ref Zipcode, ref Country); >>>>> >>>>> loCass = loBridge.CreateInstance("Cass") >>>>> if isnull(loCass) >>>>> ? loBridge.cErrorMsg >>>>> return >>>>> endif >>>>> >>>>> *loPop.Connect("mail.gorge.net",587,.f.) >>>>> >>>>> >>>>> * loPop.Connect("mail.gorge.net",587,.f.) >>>>> *? loBridge.InvokeMethod(loPop,"Connect","pop3.gorge.net",110,.f.) >>>>> >>>>> ? loCass.VerifyAddress(@Address1, @Address2, @City, @State, @Zipcode, @Country) >>>>> endif >>>>>endif >>>>>>>>>>