Click here to Skip to main content
15,886,693 members
Home / Discussions / C#
   

C#

 
GeneralRetrieve the Name of a Disk Drive Pin
Mark Sanders28-Jan-03 5:30
Mark Sanders28-Jan-03 5:30 
GeneralRe: Retrieve the Name of a Disk Drive Pin
thematt28-Jan-03 6:31
thematt28-Jan-03 6:31 
GeneralRe: Retrieve the Name of a Disk Drive Pin
Mark Sanders28-Jan-03 7:41
Mark Sanders28-Jan-03 7:41 
GeneralRe: Retrieve the Name of a Disk Drive Pin
thematt28-Jan-03 7:54
thematt28-Jan-03 7:54 
GeneralRe: Retrieve the Name of a Disk Drive Pin
Mark Sanders28-Jan-03 7:59
Mark Sanders28-Jan-03 7:59 
GeneralRe: Retrieve the Name of a Disk Drive Pin
fhsBlue28-Jan-03 10:53
fhsBlue28-Jan-03 10:53 
QuestionHow to get values stored in Scripting.Dictionary instance. Pin
Christian Merritt28-Jan-03 3:33
Christian Merritt28-Jan-03 3:33 
AnswerRe: How to get values stored in Scripting.Dictionary instance. Pin
Richard Deeming28-Jan-03 4:05
mveRichard Deeming28-Jan-03 4:05 
Try this:
using System;
using System.Collections;
using System.Collections.Specialized;
 
public class ScriptingUtils
{
    public static IDictionary ConvertDictionary(Scripting.IDictionary dict)
    {
        HybridDictionary ret = new HybridDictionary(dict.Count);
        
        foreach(object k in dict)
        {
            // Can't pass k as ref, because it's read-only
            object key = k;
            
            // Can't pass a ref to an indexer
            // Use the accessor method instead
            object value = dict.get_Item(ref key);
            
            ret.Add(key, value);
        }
        
        return ret;
    }
}
You can then change your code to:
using System;
using System.Collections;
...
    // AD path to bind to
    string ADsPath = "LDAP://CN=Some List,OU=Distribution Lists,DC=DomainA,DC=CorpA,DC=com";
    
    // instantiate the vender COM object
    AGQueryClass ag = new AGQueryClass();
    
    // bind to the AD path
    ag.Set(ADsPath);
    
    IDictionary dict = ScriptingUtils.ConvertDictionary(
        (Scripting.IDictionary)ag.Parameters);
    
    object[] keys = new object[dict.Count];
    object[] values = new object[dict.Count];
    int index = 0;
    
    foreach(DictionaryEntry entry in dict)
    {
        // Do something with the entry here...
        keys[index] = entry.Key;
        values[index] = entry.Value;
        index++;
    }
...



"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
GeneralRe: How to get values stored in Scripting.Dictionary instance. Pin
Christian Merritt28-Jan-03 6:04
Christian Merritt28-Jan-03 6:04 
GeneralReflection not reflecting! Pin
FruitBatInShades28-Jan-03 2:57
FruitBatInShades28-Jan-03 2:57 
GeneralRe: Reflection not reflecting! Pin
Heath Stewart28-Jan-03 3:52
protectorHeath Stewart28-Jan-03 3:52 
GeneralRe: Reflection not reflecting! Pin
FruitBatInShades29-Jan-03 2:37
FruitBatInShades29-Jan-03 2:37 
Questionhow to hide/disable Form.Close "X" ? Pin
Chris Richner28-Jan-03 2:56
Chris Richner28-Jan-03 2:56 
AnswerRe: how to hide/disable Form.Close "X" ? Pin
Heath Stewart28-Jan-03 3:44
protectorHeath Stewart28-Jan-03 3:44 
GeneralRe: how to hide/disable Form.Close "X" ? Pin
Chris Richner28-Jan-03 4:25
Chris Richner28-Jan-03 4:25 
GeneralRe: how to hide/disable Form.Close "X" ? Pin
Chris Richner29-Jan-03 22:42
Chris Richner29-Jan-03 22:42 
Generaleasy ToolBar q. Pin
jtmtv1828-Jan-03 0:18
jtmtv1828-Jan-03 0:18 
GeneralRe: easy ToolBar q. Pin
Chris Richner28-Jan-03 3:08
Chris Richner28-Jan-03 3:08 
QuestionOfficeApp (Word, Excel, Outlook) as MdiChild in my MdiForm ? Pin
Chris Richner27-Jan-03 22:38
Chris Richner27-Jan-03 22:38 
GeneralSave a drawing on the disk Pin
moshu27-Jan-03 22:31
moshu27-Jan-03 22:31 
GeneralRe: Save a drawing on the disk Pin
Heath Stewart28-Jan-03 3:56
protectorHeath Stewart28-Jan-03 3:56 
GeneralOpen MSProject2000 inside a windows form Pin
Member 20085527-Jan-03 17:06
Member 20085527-Jan-03 17:06 
GeneralCall DLL From C#app OK. But SOAP no. Pin
Dato27-Jan-03 15:14
Dato27-Jan-03 15:14 
GeneralBest Way to Move very Large Float[,] across TCP/IP Pin
Deane27-Jan-03 14:04
Deane27-Jan-03 14:04 
GeneralRe: Best Way to Move very Large Float[,] across TCP/IP Pin
Nathan Blomquist27-Jan-03 17:51
Nathan Blomquist27-Jan-03 17:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.