How to get the Actual Link file location in VSS?

Posted by Regi on Stack Overflow See other posts from Stack Overflow or by Regi
Published on 2009-12-09T09:23:47Z Indexed on 2010/05/23 4:40 UTC
Read the original article Hit count: 196

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?

© Stack Overflow or respective owner

Related posts about visual-sourcesafe

Related posts about visual-sourcesafe-2005