Help using multiple languages

Z

Zeke Zinzul

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
 
G

Guest

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.
 
G

Guest

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"
 
C

Cor Ligthert [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top