call a vb function with out paramaters
-
i am using csharp and i am calling a dll that was written in vb 6 and one of its methods i call has a optional parameter how do i call this function without a parameter without throwing a compiler error
Thanks, Chad Aiena
I've never tried this so I'm only really guessing here, but have you tried passing in null?
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
I've never tried this so I'm only really guessing here, but have you tried passing in null?
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
i am using csharp and i am calling a dll that was written in vb 6 and one of its methods i call has a optional parameter how do i call this function without a parameter without throwing a compiler error
Thanks, Chad Aiena
VC# if I am correct does not support optional parameters. Have you tried creating an empty object of the type the parameter is set to be. Or you could possibly import Microsoft.VisualBasic namespace and use the vbNull constant and use that. What is the compiler error?
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]
-
i am using csharp and i am calling a dll that was written in vb 6 and one of its methods i call has a optional parameter how do i call this function without a parameter without throwing a compiler error
Thanks, Chad Aiena
Hi, I havent done this (I am not actively using VB) but I guess you cannot really do it, unless you cheat a little by inserting a code layer in C# that offers you two methods (one with, one without the optional out parameter), and have them both call the VB code WITH the out parameter present (one real, one dummy). :)
Luc Pattyn
-
i am using csharp and i am calling a dll that was written in vb 6 and one of its methods i call has a optional parameter how do i call this function without a parameter without throwing a compiler error
Thanks, Chad Aiena
Just pass "System.Reflection.Missing.Value" for the optional parameter.
David Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C# to C++ converter, VB to C++ converter Instant Python: C# to Python converter, VB to Python converter