Using variants in COM Interop
-
Hello, I have a function in C# dll [ComVisible] that has an out parameter.
public void MyFunc(out string mystr) { mystr = "ABC"; }
I also have a function in VB that gives a call to MyFunc in C# code.myobj.MyFunc(**/*Don't know what to put here. I have to get the value from C# in a variant though*/**)
Can someone help me on this?You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Hello, I have a function in C# dll [ComVisible] that has an out parameter.
public void MyFunc(out string mystr) { mystr = "ABC"; }
I also have a function in VB that gives a call to MyFunc in C# code.myobj.MyFunc(**/*Don't know what to put here. I have to get the value from C# in a variant though*/**)
Can someone help me on this?You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
The out keyword causes arguments to be passed by reference. This is similar to the ref keyword, except that ref requires that the variable be initialized before being passed. To use an out parameter, both the method definition and the calling method must explicitly use the out keyword. For example: http://msdn.microsoft.com/en-us/library/t3c3bfhx(VS.80).aspx[^]
If you can think then I Can.