I have created a Flavored project, and have subscribed to
IVsHierarchyEvents.
When the OnItemAdded event is fired, I am inspecting the file that was
just added via the itemId passed in, and if it is a file I am interested
in, I would like to add additional properties to this nodes item in the
project file. I use the IVsBuildPropertyStorage::SetItemAttribute()
member, however if I try to do call during the OnItemAdded event, it
does not persist anything and returns E_FAIL.
I know the itemId is correct, because during the OnItemAdded event, I
call IVsProject::GetMkDocument on the same itemId and it returns the
file path.
Why would this be failing, and how would I go about updating the project
file when this item is added?
Cheers,
Stuart
Stuart Carnie - 30 Mar 2006 17:57 GMT
> I have created a Flavored project, and have subscribed to
> IVsHierarchyEvents.
[quoted text clipped - 16 lines]
>
> Stuart
Also, is there a way when an item is added to the IVsHierarchy of my
Flavored project, I can override the item type it is created as or do I
have to use the Automation model and do it after it has been added?
Example, rather than my xml document being added to the project as
<ItemGroup>
<None Include="my.myxml" />
</ItemGroup>
can I hook the IVsHierarchy somehow, so it is automatically added as,
with additional data
<ItemGroup>
<MyXml Include="my.myxml">
<Data1>MyExtraData</Data1>
</MyXml>
</ItemGroup>
Cheers,
Stu
"Gary Chang[MSFT]" - 31 Mar 2006 07:58 GMT
Hi Stuart,
Thank you posting!
This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.
Thanks for your understanding.
Best regards,
Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.