Help using multiple languages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zeke Zinzul

    #1

    Help using multiple languages

    Hi,

    I am writing a simple graphics program to generate a Yin Yang logo. I need
    to implement a flood fill routine and am trying to write a stack class in
    C#. My main program is in VB.

    My solution is called "Yin-Yang", containing the two projects.

    My C# project is called coordstack with a class file in it called stack.cs.
    This file contains a namespace called "coordstack " and a class, also called
    "coordstack ". This is a class library.

    My VB program is called "Yin-Yang", same as the solution. This is a windows
    application.

    How do I go about declaring a variable in my main VB program (a subroutine
    in form1) of type "coordstack " which is in the C# project?

    I want to say: Dim s as coordstack

    I get an error: "type coordstack is not defined".

    When I try an "imports coordstack" I get an error, "namespace or type
    coordstack for the imports "coordstack " cannot be found.

    Can someone show me the way?

    I am using Visual Studio .Net, the one before 2005.

    Thanks, Zeke


  • iwdu15

    #2
    RE: Help using multiple languages

    compile your C# class into a .dll, then in your vb project, in the solution
    explorer, add a reference to the C# dll you just compiled. at the top of your
    code in VB, add the imports statement.
    --
    -iwdu15

    Comment

    • GhostInAK

      #3
      RE: Help using multiple languages

      Hello iwdu15,

      It'll Probably be Imports Yin_Yang
      [color=blue]
      > compile your C# class into a .dll, then in your vb project, in the
      > solution explorer, add a reference to the C# dll you just compiled. at
      > the top of your code in VB, add the imports statement.
      >[/color]


      Comment

      • iwdu15

        #4
        RE: Help using multiple languages

        how do you figure? the main program in Yin_Yang, which he is the importing
        the C# file into the VB file. His C# class is named "stack" which means the
        imports statement will be "Imports Stack"
        --
        -iwdu15

        Comment

        • Cor Ligthert [MVP]

          #5
          Re: Help using multiple languages

          Zeke,

          In addition to iwdu15

          You can as well add the C# project to your current project.
          Be sure that it is a DLL library project or change that in the properties.
          Go to Project -> Add reference choose for project; than you see that in the
          box
          Select that and you are ready again.

          I hope this helps,

          Cor

          "Zeke Zinzul" <zeke@shambolic a.demon.co.uk> schreef in bericht
          news:e67ikg$jfg $1$8300dec7@new s.demon.co.uk.. .[color=blue]
          > Hi,
          >
          > I am writing a simple graphics program to generate a Yin Yang logo. I need
          > to implement a flood fill routine and am trying to write a stack class in
          > C#. My main program is in VB.
          >
          > My solution is called "Yin-Yang", containing the two projects.
          >
          > My C# project is called coordstack with a class file in it called
          > stack.cs. This file contains a namespace called "coordstack " and a class,
          > also called "coordstack ". This is a class library.
          >
          > My VB program is called "Yin-Yang", same as the solution. This is a
          > windows application.
          >
          > How do I go about declaring a variable in my main VB program (a subroutine
          > in form1) of type "coordstack " which is in the C# project?
          >
          > I want to say: Dim s as coordstack
          >
          > I get an error: "type coordstack is not defined".
          >
          > When I try an "imports coordstack" I get an error, "namespace or type
          > coordstack for the imports "coordstack " cannot be found.
          >
          > Can someone show me the way?
          >
          > I am using Visual Studio .Net, the one before 2005.
          >
          > Thanks, Zeke
          >[/color]


          Comment

          • GhostInAK

            #6
            RE: Help using multiple languages

            Hello iwdu15,

            Because you dont import classes.. you import namespaces.

            -Boo
            [color=blue]
            > how do you figure? the main program in Yin_Yang, which he is the
            > importing the C# file into the VB file. His C# class is named "stack"
            > which means the imports statement will be "Imports Stack"
            >[/color]


            Comment

            Working...