out Questions

2

Solved

Is there a way to know if an out parameter was set already or not. This is the pseudocode for what I am looking for: public virtual string blabla(long num, out bool bval) { if (!bval.HasValue) ...
Rebuff asked 28/4, 2012 at 18:31

4

Just noticed this doesn't work: var dict = new Dictionary<int, XElement>(); XContainer element; //... if (dict.TryGetValue(idx, out element)) { //... Then I tried this: class A { } class ...
Messinger asked 18/2, 2012 at 14:7

4

Solved

I have a bit of COM code that uses interface pointers. The original author of the code implemented functions that return an interface pointer like this: HRESULT Query ( IN BSTR sQuery, OUT IEnumWb...
Radbun asked 7/12, 2011 at 23:27

4

Solved

I've got a project in c# which is making use of another project written in vb.net. I am currently able to modify both. I've got a method in the VB project like: Public Sub MethodName(ByVal param...
Harvell asked 8/8, 2011 at 8:50

2

Solved

public class Foo { public void DoFoo() { int x; var coll = TheFunc("bar", out x); } public Func<string, int, ICollection<string>> TheFunc { get; set; } } Error: "Argument 2 sho...
Romans asked 22/7, 2011 at 20:19

2

Solved

I just want to call the GenerateScript method of Microsoft.Data.Schema.ScriptDom.Sql.Sql100ScriptGenerator from PowerShell. #C public void GenerateScript( IScriptFragment scriptFragment, out st...
Eleanoreleanora asked 11/3, 2011 at 18:12

1

Solved

Does boxing/unboxing occur when a method accepts an out/ref parameter of a ValueType?
Grenoble asked 24/2, 2011 at 10:7

2

Solved

Given this magical interface: public interface IHat<out TRabbit> { TRabbit Take(); } And this class hierarchy: public class Rabbit { } public class WhiteRabbit : Rabbit { } I can now ...
Sievert asked 9/2, 2009 at 11:14

4

Solved

I am using contactsreader.dll to import my Gmail contacts. One of my method has the out parameter. I am doing this: Gmail gm = new Gmail(); DataTable dt = new DataTable(); string strerr; gm.GetCon...
Frymire asked 9/6, 2010 at 7:54

3

Solved

Func<a, out b, bool>, just don't compile, how to declare that i want the second parameter be an out one? I want to use it like this: public class Foo() { public Func<a, out b, b...
Congreve asked 15/3, 2010 at 14:56

2

Solved

In C# PInvoke, how do I pass a string buffer so that the C DLL fills it and returns? What will be the PInvoke declaration? The C function declaration is int GetData(char* data, int buflength); ...
Deedeeann asked 3/1, 2010 at 10:2

8

Solved

When a C# function has an output parameter, you make that clear as follows: private void f(out OutputParameterClass outputParameter); This states that the parameter does not have to be initializ...
Cloutman asked 8/9, 2009 at 13:11

7

Solved

Here is what I understand so far: PASS BY VALUE Passing by value means a copy of an argument is passed. Changes to that copy do not change the original. PASS BY REFERENCE Passing by reference means...
Burdock asked 5/11, 2009 at 20:33

6

Solved

Do out parameters in C# have any performance implications I should know about? (Like exceptions) I mean, is it a good idea to have a method with an out parameter in a loop that will run a couple o...
Alcheringa asked 9/2, 2009 at 12:31

© 2022 - 2024 — McMap. All rights reserved.