Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Please help with programmatic access to vsprops file

15 views
Skip to first unread message

Anthony Wieser

unread,
Jan 4, 2008, 12:45:54 PM1/4/08
to
Hello,

I'm trying to build a custom C++ wizard to build my projects, but I've come
unstuck trying to add a user property page.

In visual studio, I can create a file which is a Visual Studio Property
Sheet, named for instance version.vsprops

I can then go to the property manager window, and add an existing property
sheet.

Naively, I hoped I could find out what was going on by recording a macro,
but that didn't work.

So, my question is:

How can I programmatically add a vsprops file to a project. There seems to
be a VCPropertySheet interfacec, but I can't for the life of me figure out
what object will give me one.

I hope someone here can help.

Anthony Wieser
Wieser Software Ltd


Anthony Wieser

unread,
Jan 4, 2008, 5:18:37 PM1/4/08
to
I've got a bit further, but still can't figure out how to add an object.

Let's say I want to add a my version.vsprops to every configuration.

Here's what I have:

sub addVersion(prj as VCProject)
{
dim config as VCConfiguration
dim sheets as Object
dim prjProp as VCPropertySheet

for each config in prj.Configurations
sheets = config.PropertySheets;

// how do I add a new prjProp to the collection of property sheets?

prjProp.Name = "version"
prjProp.PropertySheetFile = "fullpath\version.vsprops"
next
}

I tried Add on the sheets method but that method doesn't seem to exist.


Any Suggestions?

Anthony Wieser
Wieser Software Ltd

"Anthony Wieser" <newsgroup...@wieser-software.com> wrote in message
news:u9AGjnvT...@TK2MSFTNGP05.phx.gbl...

Anthony Wieser

unread,
Jan 5, 2008, 12:08:32 PM1/5/08
to
OK, it seems odd, but the way to do this is to set the
InheritedPropertySheets property of the config to a semicolon delimited list
of property sheets (vsprop files) you want added.

Anthony Wieser
Wieser Software Ltd

"Anthony Wieser" <newsgroup...@wieser-software.com> wrote in message

news:OziFE$xTIHA...@TK2MSFTNGP02.phx.gbl...

Madhura K

unread,
Aug 5, 2011, 7:10:06 PM8/5/11
to

I tried using
cofig.InheritedPropertySheets
to set property sheets but it didnt work.

did it work for you?

> On Friday, January 04, 2008 12:45 PM Anthony Wieser wrote:

> Hello,
>
> I'm trying to build a custom C++ wizard to build my projects, but I've come
> unstuck trying to add a user property page.
>
> In visual studio, I can create a file which is a Visual Studio Property
> Sheet, named for instance version.vsprops
>
> I can then go to the property manager window, and add an existing property
> sheet.
>
> Naively, I hoped I could find out what was going on by recording a macro,
> but that didn't work.
>
> So, my question is:
>
> How can I programmatically add a vsprops file to a project. There seems to
> be a VCPropertySheet interfacec, but I can't for the life of me figure out
> what object will give me one.
>
> I hope someone here can help.
>
> Anthony Wieser
> Wieser Software Ltd


>> On Friday, January 04, 2008 5:18 PM Anthony Wieser wrote:

>> I've got a bit further, but still can't figure out how to add an object.
>>
>> Let's say I want to add a my version.vsprops to every configuration.
>>
>> Here's what I have:
>>
>> sub addVersion(prj as VCProject)
>> {
>> dim config as VCConfiguration
>> dim sheets as Object
>> dim prjProp as VCPropertySheet
>>
>> for each config in prj.Configurations
>> sheets = config.PropertySheets;
>>
>> // how do I add a new prjProp to the collection of property sheets?
>>
>> prjProp.Name = "version"
>> prjProp.PropertySheetFile = "fullpath\version.vsprops"
>> next
>> }
>>
>> I tried Add on the sheets method but that method doesn't seem to exist.
>>
>>
>> Any Suggestions?
>>
>> Anthony Wieser
>> Wieser Software Ltd
>>
>> "Anthony Wieser" <newsgroup...@wieser-software.com> wrote in message
>> news:u9AGjnvT...@TK2MSFTNGP05.phx.gbl...

0 new messages