|
-
March 30th, 2010, 05:16 AM
#6
Re: How to catch error: The instruction at '' referenced memory at ''. The memory cou
Hi Skizmo,
Oh I see, thank you. By any chance, do you know how I can check if a VARIANT has no value? I mean if it was initialized like this but did not assign any value.
VARIANT varAtt;
I am using this code now:
VARIANT varAtt;
IXMLDOMNode* pAtt = NULL;
_bstr_t tempb = attribute.c_str();
//Process varSource first to determine if to use WMI or TSVar
BSTR bstrAtt = tempb.copy();
if (pNodeMap != NULL)
{
pNodeMap->getNamedItem(bstrAtt,&pAtt);
if (pAtt != NULL)
{
pAtt->get_nodeValue(&varAtt);
SAFE_RELEASE(pAtt);
}
}
return varAtt;
So I can avoid getting an attribute if it does not exist. I want to check now if the returned VARIANT has been assigned to or not.
Thank you very much!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|