ref

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello;

I have 3 projects, project 1 + 2 are vb.net, project 3 in C#


project 3 : (C#)
public Class3(project2 x)

project 1
public sub ()
dim y as project2.class2()
dim x as project3.class3 = new project3.class3(y)
end sub

All I need to do is to send a referense of a third class between two
projects, one in c# and a second in VB.... this is not working well for me, I
heard I need to have som kind of ref function that returns a referens om my y
object and that I need to send the referens to class3..

Help, how can I don that
 
Lamis,

I am not sure what you mean with Send.

If you want to implement your C# class into your total project.
Than you can just add it as project and tell that it is a class libary in
the project properties of that and than do in your mainproject

Project -> add reference -> projects and click on the C# project that you
see.

Cor
 
hi core,

I have already all the three projects in the same solution.. I need to pass
by a reference from a VB project to a C# project... the reference is an
object of a class in a VB third project.... this would work prefectly if all
three projects were written i C# or in VB... to pass an C# object to VB I
only need to type passobject(ref o) to make it work... I thought byref would
work, but it doesn't....
my theori is since I am typin passobject(o) in VB where passobject is a
method in a C# project, I need to send a reference to the object, not the
object it self...

I don't know if I just made it more confusing... I am very thankfull for the
help
 
In the Class3 constructor you have used the namespace project2 instead
of the class name project2.class2.
 
Hej Göran

Jag har skrivit rätt i min kod.... felet som jag får upp är att det inte
finns konstruktor i project 3 som kan ta emot ett sådan argument.. Skapar jag
3 C# project så fungerar min kod utmärkt... Vill jag passera object från C#
till VB project så går det också bra, dock måste jag skriva ref i mitt
anrop... Så det måste vara något man ska göra för att få det fungera åt andra
hållet..

Någon tipsade mig om att jag ska skriva någon function som returnerar en
referense av objectet och det är referencen som skickas vidare till C#
projektet..

usch, man ska inte blanda flera språk i en solution, det blir bara soppa av
det hela
 
Lamis,

Het is geen probleem om in je moederstaal in deze nieuwsgroepen met anderen
te converseren, maar zet er dan wel a.u.b. een Engelse vertaling bij. Deze
nieuwsgroepen zijn bedoeld als community to learn from each other..

It is no problem to conversate with others in your native language in these
newstroups, but please place than a translation in English too. These
newsgroups are mean as community to learn from each other.

Cor
 
Lamis,

It should not make any difference if the projects are in C#, VBNet, J# or
managed C+.

If the project is not CLI compliant than that will be told too you when you
add the reference to the project. (By instance as a *public* name is used
twice with as only difference the uper and lower case)

I hope this helps,

Cor
 
Hi Cor
u r absolutly right, sorry
--
LZ


Cor Ligthert said:
Lamis,

Het is geen probleem om in je moederstaal in deze nieuwsgroepen met anderen
te converseren, maar zet er dan wel a.u.b. een Engelse vertaling bij. Deze
nieuwsgroepen zijn bedoeld als community to learn from each other..

It is no problem to conversate with others in your native language in these
newstroups, but please place than a translation in English too. These
newsgroups are mean as community to learn from each other.

Cor
 
Back
Top