|
-
July 13th, 2004, 01:39 PM
#1
Interoperability between COM client and .NET Server
I am looking into the COM Interoperating Sample from MSDN:
COM Client and .NET Server:
msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp
The .NET Server defines ILoan interface which is implemented by Loan class in C#.
The function "ComputePayment" defined and implemented as follows:
namespace LoanLib {
public interface ILoan {
...
double ComputeOpeningBalance();
...
};
public class Loan : ILoan {
...
public double ComputePayment() {
Payment = Util.Round(OpeningBalance * (Rate / (1 -
Math.Pow((1 + Rate), - Term))), 2);
return Payment;
}
...
};
}
Here is question:
When this function is called from VC++ 6.0 client, the signature of this function is quite different.
pILoan->ComputePayment(&payment);
The return value is moved to the end of argument list. Can anyone explain
why this is happening? Thanks
-
July 13th, 2004, 03:38 PM
#2
Hi Bobby,
Its COM. COM always returns a HRESULT (hopefully S_OK). The parameter that the client receives back (such as VB or VBScript) is passed as an [out, retval] parameter.
See http://www.codeguru.com/forum/showthread.php?t=302058
Jeff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|