I've put my code below to show you what I have. The issue is that when I
step past the _NewEnum call the application uses 50% CPU and nothing
happens. What am I doing wrong? Is there a library I'm not including?
void__fastcall TfrmMain::DumpItemHistory(IVSSItem *ptr_VssItem)
{
BSTR bstrval;
char lpbuf[200];
char lpbuf2[200];
IVSSItem *vssi;
IVSSVersion *vers;
IVSSVersions *vx;
LPUNKNOWN lpunk;
IEnumVARIANT *ppvobj;
VARIANT st;
ULONG fetched;
long lvnum;
memLastComment->Lines->Clear();
if( S_OK == ptr_VssItem->get_Versions( 0l, &vx ) )
{
if( S_OK == vx->_NewEnum(&lpunk) )
{
if(!FAILED(lpunk->QueryInterface(IID_IEnumVARIANT, (void**)&ppvobj)))
{
vssi->get_Spec( &bstrval );
WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)bstrval, -1, lpbuf,
sizeof(lpbuf), NULL, NULL );
memLastComment->Text += "History of: " + (String)lpbuf + "\n";
memLastComment->Text += "ACTION USER NAME VERSION NUMBER\n";
do
{
ppvobj->Next( 1UL, &st, &fetched );
if( fetched != 0 )
{
if(!FAILED(st.punkVal->
QueryInterface(IID_IVSSVersion,(void**)&vers)))
{
vers->get_Action( &bstrval );
WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)bstrval, -1,
lpbuf, sizeof(lpbuf), NULL, NULL );
vers->get_Username( &bstrval );
WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)bstrval, -1,
lpbuf2, sizeof( lpbuf2 ), NULL, NULL );
vers->get_VersionNumber( &lvnum );
memLastComment->Text += (String)lpbuf + " " + (String)lpbuf2 + " "
+ lvnum + "\n";
vers->Release();
}
st.punkVal->Release();
}
} while( fetched != 0 );
ppvobj->Release();
}
lpunk->Release();
}
vx->Release();
}
}
//---------------------------------------------------------------------------