39

 

You may be wondering why we do not call ExecMethod as:

 

VarTmp = ExecMethod(IE,'Navigate', &
VariantCreate(VT_BSTR,'www.canaimasoft.com/f90VB'), &
iRet=iRet)

 

This would have also worked, but your program would leak memory. When you create a variant with a BString, f90VB allocates the memory for the BString and then assigns the string handle to the variant. You must clear the variant (calling VariantClear) to release the memory used by the BString, which would be impossible to do with this calling variety. The same applies to variants containing Safe Arrays. For non-allocated types, like variants containing integers, reals, etc. this is not a problem.