none
Idl file for example at https://docs.microsoft.com/en-us/dotnet/framework/interop/com-interop-sample-net-client-and-com-server RRS feed

All replies

  • Hi,

    Thank you for posting here.

    >>Can you please share .idl file for sample

    We couldn't find the complete samples for the MSDN code snippets referred to above. So I couldn't share .idl file for sample.

    However, I suggest you could download and ferer to the complete samples as follows:
    https://www.codeproject.com/Articles/12579/Building-COM-Servers-in-NET

    Best Regards,

    Jeanine Zhang

     
    • Proposed as answer by Guido Franzke Monday, September 23, 2019 9:50 AM
    Monday, September 23, 2019 9:44 AM
    Moderator
  • Hello xyzam,

    1. After observing the code for the CLoan class in the sample at the link, I reverse engineered it and emerged the following sample IDL :

    // LoanCOMServer.idl : IDL source for LoanCOMServer
    //
    
    // This file will be processed by the MIDL tool to
    // produce the type library (LoanCOMServer.tlb) and marshalling code.
    
    import "oaidl.idl";
    import "ocidl.idl";
    
    [
    	uuid(45DF277A-ACD8-40D5-876A-CE1417D2668F),
    	version(1.0),
    ]
    library LoanCOMServerLib
    {
    	importlib("stdole2.tlb");
    
    	[
    		object,
    		uuid(D25CF7A2-58CE-420C-A801-9888DB57BA8A),
    		dual,
    		nonextensible,
    		pointer_default(unique)
    	]
    	interface ILoan : IDispatch {
    		[propget, id(1)] HRESULT OpeningBalance([out, retval] DOUBLE* pVal);
    		[propput, id(1)] HRESULT OpeningBalance([in] DOUBLE newVal);
    		[propget, id(2)] HRESULT Rate([out, retval] DOUBLE* pVal);
    		[propput, id(2)] HRESULT Rate([in] DOUBLE newVal);
    		[propget, id(3)] HRESULT Payment([out, retval] DOUBLE* pVal);
    		[propput, id(3)] HRESULT Payment([in] DOUBLE newVal);
    		[propget, id(4)] HRESULT Term([out, retval] SHORT* pVal);
    		[propput, id(4)] HRESULT Term([in] SHORT newVal);
    		[id(5)] HRESULT ComputePayment([out, retval] DOUBLE* pVal);
    		[id(6)] HRESULT ComputeOpeningBalance([out, retval] DOUBLE* pVal);
    		[id(7)] HRESULT ComputeRate([out, retval] DOUBLE* pVal);
    		[id(8)] HRESULT ComputeTerm([out, retval] SHORT* pVal);
    		[id(9)] HRESULT GetFirstPmtDistribution([in] DOUBLE PmtAmt, [out] DOUBLE* Balance, [out] DOUBLE* PrinPortion, [out] DOUBLE* IntPortion, [out, retval] VARIANT_BOOL* pVal);
    		[id(10)] HRESULT GetNextPmtDistribution([in] DOUBLE PmtAmt, [in] DOUBLE* Balance, [out] DOUBLE* PrinPortion, [out] DOUBLE* IntPortion, [out, retval] VARIANT_BOOL* pVal);
    		[propget, id(11)] HRESULT RiskRating([out, retval] BSTR* pVal);
    		[propput, id(11)] HRESULT RiskRating([in] BSTR newVal);
    	};
    
    	[
    		uuid(39A45982-B6F1-4F7E-9D44-250D9489E057)		
    	]
    	coclass Loan
    	{
    		[default] interface ILoan;
    	};
    };
    
    

    2. Note that the GUIDs listed above are produced by me for testing purposes. They are of course not the ones produced by the original writers of CLoan.

    3. Hope this will be helpful.

    - Bio.


    Please visit my blog : http://limbioliong.wordpress.com/

    Tuesday, September 24, 2019 9:55 AM