Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 5th, 2005, 09:34 PM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Extracting COM Object Properties

I am learning C# using the Wrox Professional C# 3rd Edition book and am trying to apply what I have been learning about Collections to a project that I am working on. I have a COM Object Collection that I am attempting to extract properties from and am getting errors using this syntax:

foreach (object objItem in wrkspace.Errors)
{
    Response.Write(objItem.Description);
}

This object I am trying to access has the following methods and properties according to the VS Object Browser:

Methods:
Add
GetEnumerator
Refresh
Remove
StartLogging
StopLogging

Properties:
Count
Item
LogFileName
Logging

No matter what I try, I am unable to access these properties or methods. When I programmed this same code in VB.NET without using Option Strict, the code worked just fine allowing me to access the methods and properties. I have also tried using GetEnumerator with no success. Here is the code I used for that:

IEnumerator myErrorEnumerator = wrkspace.Errors.GetEnumerator();

I receive an error using this telling me that wrkspace.Errors doesn't have a definition for GetEnumerator. What am I missing here or am I totally off base.

Any guidance would be greatly appreciated. Thanks in advance. Take Care and Have a Great Day.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting Custom Document Properties for Word Doc jayanth_nadig XSLT 2 October 30th, 2007 03:31 AM
how to access parent object properties kaos_frack Javascript How-To 4 July 31st, 2007 04:31 AM
problem Extracting Data using HTML Object Library method VB How-To 0 May 12th, 2006 02:52 AM
Object properties in an ArrayList augustwest C# 4 June 16th, 2004 04:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.