L
Lynn McGuire
I am having a problem with Excel 2003 running out of "memory
handles" on my Windows 7 x64 box after creating several hundred
excel spreadsheets. I am explicitly releasing all of my Dispatch
pointers. Do I need to explicitly release my variants after I
store a bstr in them ? For instance, the following code converts
a cell range string into a bstr and gets excel to return a Dispatch
pointer for putting stuff into that range.
VARIANT range;
VariantInit ( & range);
range.vt = VT_BSTR;
_bstr_t address = _bstr_t (cellAddress.c_str ());
range.bstrVal = address;
std::string errorMsg = "Select a range in the active spreadsheet, " + cellAddress +
" (PutStringInServer)";
OLEMethod (DISPATCH_PROPERTYGET, & result1, pExcelSheet, L"Range", errorMsg, 1, range);
if (result1.vt == VT_DISPATCH)
{
....
So, do I need to release the range variant variable ?
Thanks,
Lynn
handles" on my Windows 7 x64 box after creating several hundred
excel spreadsheets. I am explicitly releasing all of my Dispatch
pointers. Do I need to explicitly release my variants after I
store a bstr in them ? For instance, the following code converts
a cell range string into a bstr and gets excel to return a Dispatch
pointer for putting stuff into that range.
VARIANT range;
VariantInit ( & range);
range.vt = VT_BSTR;
_bstr_t address = _bstr_t (cellAddress.c_str ());
range.bstrVal = address;
std::string errorMsg = "Select a range in the active spreadsheet, " + cellAddress +
" (PutStringInServer)";
OLEMethod (DISPATCH_PROPERTYGET, & result1, pExcelSheet, L"Range", errorMsg, 1, range);
if (result1.vt == VT_DISPATCH)
{
....
So, do I need to release the range variant variable ?
Thanks,
Lynn