Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Thread Tools Rate Thread Display Modes
Old 04-21-2004, 03:00 PM
mballou mballou is online now
Registered User
Join Date: 04-21-2004
Posts: 8
Problem with VisBuild.Interop assembly

I have a C# app I wrote to automate running several build scripts created with Visual Build. Everything is working great. Using code, I'm able to launch Visual Build, load the project and build it getting back log messages perfectly.

My problem is that I would like to create a percent complete based on the current step number and the total number of steps. Should be very easy to do, but the Interop DLL doesn't include the Steps property on the IProject interface so that I can get the count.

I think this is a limitation of .NET because its a property that takes an [in] parameter for the type of Steps to return. However a get property in .NET cannot have parameters so it is not accessible. The Object browser does not show the property and trying to use it anyways results in a compiler error.

I believe this may be an issue for other properties also, but that's the first one I ran into. Using ildasm.exe on the Interop assembly shows the Steps property and the get_Steps internal method, but neither are exposed to use in my own application because of the limitation.

I tried creating my own interop dll and even modifying your type library but I was unable to get it to work.

From past experience, if a property needs an [in] parameter, you need to change it to a method instead. I realize this is difficult to do from a COM type library since you don't want to break backward compatibility.
Do you have any suggestions for getting this to work?

Mike Ballou
Reply With Quote
Old 04-21-2004, 03:50 PM
kinook kinook is online now
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
I'm not aware of any limitations calling COM properties that take parameters from .NET (in fact, the NETAction sample user action does this to retrieve step properties). The IProject.Steps property is defined as the interface's default method, so in the RCW it is exposed as the default indexer property, and accessing it like this from C# worked for me:

Reply With Quote
Old 04-21-2004, 05:10 PM
mballou mballou is online now
Registered User
Join Date: 04-21-2004
Posts: 8
Thanks for the quick reply. I saw the default indexer property in the Object Browser but I didn't realize that was the Steps property. Just seemed strange that there is no property named Steps in the IProject interface of the Interop DLL.

Your solution works fine though. Thanks for the help.

Mike Ballou
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

All times are GMT -5. The time now is 05:48 PM.

Copyright 1999-2019 Kinook Software, Inc.