VariantClear return memory locked errror

  • Thread starter Thread starter an ho
  • Start date Start date
A

an ho

I was trying to get the SchemaIDGUID and I cannot clear
the Variant after I used it. I returned an error of Memory
is locked(0x8002000d)
Have anybody run into this problem before? Is there a way
to handle this problem to avoid memory leaks?

--------------------------------------------
sample code I have:
....
VariantInit(&var);
//use var somewhere here
....
VariantClear(&var);
....
pSchema->Get(L"schemaIDGUID", &var);
SafeArrayAccessData(var.parray, (void **) &pSafeVal);
StringFromGUID2((REFGUID) *pSafeVal, wVal, 40);
if ( pSafeVal )
{
SafeArrayUnaccessData(pSafeVal);
}
hr = VariantClear(&var); //This returned 0x8002000d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top