How to make arguments as optional in DCOM method ?
-
HI I am developing a DCOM project and which i want to give an optional arguments Plz tell me how to make argument as optional. My code looks like... STDMETHODIMP CInsideDCOM::vListMachine(VARIANT SrvName, VARIANT Domain) { ... ... } Suppose I want to make any one of the above arguments as optional then how to do it ? In which file to make changes ? Plz, I am in hurry... Can you tell me ? Thank you Amarelia
-
HI I am developing a DCOM project and which i want to give an optional arguments Plz tell me how to make argument as optional. My code looks like... STDMETHODIMP CInsideDCOM::vListMachine(VARIANT SrvName, VARIANT Domain) { ... ... } Suppose I want to make any one of the above arguments as optional then how to do it ? In which file to make changes ? Plz, I am in hurry... Can you tell me ? Thank you Amarelia
Hi there, What you have to modify is your IDL code to use the [optional] attribute for the method declaration. So your code should look something like this
[id(0x00000001)] HRESULT vListMachine([in] VARIANT SrvName, [in, optional] VARIANT Domain);
where Domain is an optional parameter. Check the MSDN for the MIDL optional attribute. Fabian