How to deal with reference variable in C#?
-
Hello, I have created a DLL for COM using VB 6.0. the fucntion has a reference variable which returns some value back. I am accessing this fuction in C# when i am passing the ref variable it is giving me an error. Please help. Thanks in Advance.
Bharath.S Ron
-
Hello, I have created a DLL for COM using VB 6.0. the fucntion has a reference variable which returns some value back. I am accessing this fuction in C# when i am passing the ref variable it is giving me an error. Please help. Thanks in Advance.
Bharath.S Ron
bharath.s.r wrote:
I am accessing this fuction in C# when i am passing the ref variable it is giving me an error.
What error?
Regards, Satips.:rose:
-
bharath.s.r wrote:
I am accessing this fuction in C# when i am passing the ref variable it is giving me an error.
What error?
Regards, Satips.:rose:
-
i am passing a variable as (ref var) error :- ref object is not declared. Thanks in Advance.
Bharath.S Ron
-
Reference variables are surely supported in C#. I think the problem under this case might be the use of variable without declaration.
Regards, Murali
-
can u please explain me how i have to rectify it. i Have learn't C# on my own, i was working on VB Before now has been shifted to C#. Thanks in Advance.
bharath.s
While calling the method, pass the 'reference' variables as SomeMethod(ref varInput); Then in the definition of the Method u have to use the same reference variable as, public void SomeMethod(ref varInput) { //Give ur implementation here. }
Regards, Murali
-
While calling the method, pass the 'reference' variables as SomeMethod(ref varInput); Then in the definition of the Method u have to use the same reference variable as, public void SomeMethod(ref varInput) { //Give ur implementation here. }
Regards, Murali
the method has allready being deployed in vb6.o in vb 6.0:- public function somefunc(ref variable as string) variable = "XYZ" end function in C# i have given reference to this class and function and created a Runtime callable wrapper. IN c# object.somefunc(ref csharpvar)
bharath.s
-
the method has allready being deployed in vb6.o in vb 6.0:- public function somefunc(ref variable as string) variable = "XYZ" end function in C# i have given reference to this class and function and created a Runtime callable wrapper. IN c# object.somefunc(ref csharpvar)
bharath.s
-
the method has allready being deployed in vb6.o in vb 6.0:- public function somefunc(ref variable as string) variable = "XYZ" end function in C# i have given reference to this class and function and created a Runtime callable wrapper. IN c# object.somefunc(ref csharpvar)
bharath.s