I use VSS and currently I am adding a link file using following code:
int ShareFlags = (int)VSSFlags.VSSFLAG_RECURSNO;
//Link in sourcesafe
IVSSDatabase ssdb = GetVssDatabase();
Shared.Enums.SqlObjectSubType _sqlSubType = new Shared.Enums.SqlObjectSubType();
VSSItem SourceItem = ssdb.get_VSSItem(pSourceItemPath, false);
//if source is a proj, recursively share the whole thing
if (SourceItem.Type == (int)VSSItemType.VSSITEM_PROJECT)
ShareFlags = (int)VSSFlags.VSSFLAG_RECURSYES;
VSSItem DestItem = ssdb..get_VSSItem(pDestItemPath, false);
//share the item
DestItem.Share(SourceItem, pComment, ShareFlags);
if (SourceItem.Type == (int)VSSItemType.VSSITEM_FILE)
{
bResult = true;
}
return bResult;
This will works fine. My issue is that I need to find the actual link location. For example I have a Project named as Link and it contains 2 files say file1 and file2. I added a Link to my Working project (say CurrentProject). This current project have 2 files say f1 and f2. After sharing the Link project then we get the item in Current project as:
$/CurrentProject/File1
$/CurrentProject/File2
$/CurrentProject/F1
$/CurrentProject/F2
Here File1 and File2 are link files. I need to get its parent (Actual) location i.e. $/Link/file1
and $/Link/File2
Is there any way to find Link files location using SourceSafeTypeLib?