Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. How to make arguments as optional in DCOM method ?

How to make arguments as optional in DCOM method ?

Scheduled Pinned Locked Moved COM
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    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

    F 1 Reply Last reply
    0
    • A Anonymous

      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

      F Offline
      F Offline
      f64
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups