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. C#
  4. VB6 and C# interoperation

VB6 and C# interoperation

Scheduled Pinned Locked Moved C#
csharptutorialquestion
4 Posts 4 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.
  • G Offline
    G Offline
    gus_br
    wrote on last edited by
    #1

    hey guys, what`s the fastest way to use my C# methods within my VB6 app? I`ve done it before, but i can`t remember where exactly i found the article about how to accomplish it. do you know any reference about the subject? thanks in advance cheers

    D D D 3 Replies Last reply
    0
    • G gus_br

      hey guys, what`s the fastest way to use my C# methods within my VB6 app? I`ve done it before, but i can`t remember where exactly i found the article about how to accomplish it. do you know any reference about the subject? thanks in advance cheers

      D Offline
      D Offline
      dbrenth
      wrote on last edited by
      #2

      Just reference the C# DLL in your VB App and start programming.

      Brent

      1 Reply Last reply
      0
      • G gus_br

        hey guys, what`s the fastest way to use my C# methods within my VB6 app? I`ve done it before, but i can`t remember where exactly i found the article about how to accomplish it. do you know any reference about the subject? thanks in advance cheers

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #3

        with VB6, you'll need to compile your C# as a COM object, or a completely independent app and use standard windows interprocess communications to talk between then. It's only easy if you're using VB.net since it uses the same runtime.

        -- Rules of thumb should not be taken for the whole hand.

        1 Reply Last reply
        0
        • G gus_br

          hey guys, what`s the fastest way to use my C# methods within my VB6 app? I`ve done it before, but i can`t remember where exactly i found the article about how to accomplish it. do you know any reference about the subject? thanks in advance cheers

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Like Dan said, you have to decorate your C# component with the proper COM appointments in order to use it in VB6. COM is the only interface you have to enable your component to work with VB6. C#, or and managed code library for that matter, doesn't support the necessary exports to use simple Declare statements in your VB6 code. Keep in mind, that when you use a .NET component in your VB6 code, you're bringing with it the entire weight of the .NET CLR. Be prepared to see your memory counters jump up considerably. You can learn a bit more about this process in this article[^] on MSDN. The .NET code is in VB.NET, but is easily translatable to C#. There's more in the next article[^].

          Dave Kreskowiak Microsoft MVP - Visual Basic

          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