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. Visual Basic
  4. Using variants in COM Interop

Using variants in COM Interop

Scheduled Pinned Locked Moved Visual Basic
comquestioncsharphelp
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.
  • _ Offline
    _ Offline
    _AnsHUMAN_
    wrote on last edited by
    #1

    Hello, I have a function in C# dll [ComVisible] that has an out parameter. public void MyFunc(out string mystr) { mystr = "ABC"; } I also have a function in VB that gives a call to MyFunc in C# code. myobj.MyFunc(**/*Don't know what to put here. I have to get the value from C# in a variant though*/**) Can someone help me on this?

    You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

    L 1 Reply Last reply
    0
    • _ _AnsHUMAN_

      Hello, I have a function in C# dll [ComVisible] that has an out parameter. public void MyFunc(out string mystr) { mystr = "ABC"; } I also have a function in VB that gives a call to MyFunc in C# code. myobj.MyFunc(**/*Don't know what to put here. I have to get the value from C# in a variant though*/**) Can someone help me on this?

      You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The out keyword causes arguments to be passed by reference. This is similar to the ref keyword, except that ref requires that the variable be initialized before being passed. To use an out parameter, both the method definition and the calling method must explicitly use the out keyword. For example: http://msdn.microsoft.com/en-us/library/t3c3bfhx(VS.80).aspx[^]

      If you can think then I Can.

      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