conor0callaghan
Programmer
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
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