Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / February 2006

Tip: Looking for answers? Try searching our database.

Looping thru collection works in VS2005, not IIS

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 27 Feb 2006 12:14 GMT
This code works in the VS2005 IDE using the built in web server,
however when I run it on the same machine thru IIS it throws an error.
It's suppose to loop thru all the task in a Microsoft Project file
using C#.

               object oAP = objProj.ActiveProject;
               object prjTasks =
objProj.ActiveProject.GetType().InvokeMember("Tasks",

BindingFlags.DeclaredOnly |

BindingFlags.Public | BindingFlags.NonPublic |

BindingFlags.Instance | BindingFlags.InvokeMethod, null,oAP,null);

               IEnumerable TaskList = (IEnumerable)prjTasks;
               foreach (msPrj.Task prjTask in TaskList)
               {
                   msPrj.Task myTask = (msPrj.Task)prjTask;
               }

Any ideas?
Jeff - 27 Feb 2006 12:21 GMT
One mroe thing.  Here is the error:

Unable to cast COM object of type 'System.__ComObject' to interface
type 'Microsoft.Office.Interop.MSProject.Task'. This operation failed
because the QueryInterface call on the COM component for the interface
with IID '{000C0C3F-0000-0000-C000-000000000046}' failed due to the
following error: Error loading type library/DLL. (Exception from
HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.