Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT Visual sourcesafe Variant problem

Status
Not open for further replies.

conor0callaghan

Programmer
Mar 18, 2002
20
0
0
IE
Hey,
I'm using OLE automation in C++ to add more functionality to Visual SourceSafe. I've a problem with my
IVSSItems->get_Item(variant,**bstr) method;

I'm not sure how variants work. I've attempted this before in borland C++ and it was no problem but I've been trying it with Visual C++ and its just not working.
Here is the code.
IVSSItems *pVFolder;
IVSSItem *pVRoot,*pVItem;
IVSSDatabase *pVd


pVdb->get_VSSItem(bstrSpec,0,&pVRoot);

VARIANT_BOOL varb1=false;

pVRoot->get_Items(varb1,&pVFolder);

pVFolder->get_Count(&file_count);

cout<<file_count<<endl;

VARIANT var2;

for(int i = 0; i < 13; ++i)
{
VariantInit(&var2);
var2.intVal = i+1;
//It works all the way down to here but it wont return a
//valid pVItem
pVFolder->get_Item(var2,&pVItem);
pVItem->get_Name(&bstrTemp);

convert->toString(bstrTemp);

}

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top