Paul,
Do you know if passing and returning parameters by reference is a good idea in general in C# code? I think a while ago when I was discussing some of our code that practice was considered a bad one.
I am having right now a hard time of getting that wrapper class implemented and I may need some supporting arguments of what is considered a good practice.
My colleague delegated me to a different bridge.dll my other colleague already created to use from C++ application. So, it may turn out that I will be using a different approach and not wwDotNetBridge at all.
>>I have another question. The signature for the method is this
>>
>>
>>static public string VerifyAddress( ref string AddressLine1, ref string AddressLine2, ref string City, ref string State, ref string ZipCode, ref string Country)
>>
>>So, although it may be not a good practice, my colleague (who wrote this method) returns new values using parameters passed by references. When I debug that DLL, I can see the new values, however, my call
>>
>
>I see Rick already replied, but normally if I have access to the underlying .NET source code I end up creating my own wrappers for things like this. For example, I'd create another VerifyAddress method (sorry, but yuck!) as:
>
>
>public static Address VerifyAddress(Address address)
>{
> // Code to verify address here
> // Create new Address class and populate properties, then return it.
>}
>
>public class Address
>{
> public string AddressLine1 { get; set; }
> public string AddressLine2 { get; set; }
> public string City { get; set; }
> public string State { get; set }
> public string ZipCode { get; set; }
> public string Result { get; set; }
>}
>
If it's not broken, fix it until it is.
My Blog