Люди добрые да что это такое твориться???? Не заполняет и все тут, уже так переписал:
STDMETHODIMP AFFF::GetPredefinedStrings(DISPID dispid, CALPOLESTR * lpcaStringsOut, CADWORD * lpcaCookiesOut)
{
USES_CONVERSION;
HRESULT hResult = S_FALSE;
// we should have gotten two pointers if we didn't
if((lpcaStringsOut == NULL) || (lpcaCookiesOut == NULL))
{
// we are out of here
return E_POINTER;
}
// if this is the property that we are looking for
if(dispid == 1)
{
ULONG ulElems = 2;
// allocate the memory for our string array
lpcaStringsOut->pElems = (LPOLESTR *) ::CoTaskMemAlloc( sizeof(LPOLESTR) * ulElems);
// if we couldn't allocate the memory
if(lpcaStringsOut->pElems == NULL)
// were out of here
return E_OUTOFMEMORY;
// allocate the memory for our cookie array
lpcaCookiesOut->pElems = (DWORD*) ::CoTaskMemAlloc(sizeof(DWORD*) * ulElems);
// if we couldn't allocate the memory
if (lpcaCookiesOut->pElems == NULL)
{
// free the string array
::CoTaskMemFree(lpcaStringsOut->pElems);
// exit the function
return E_OUTOFMEMORY;
}
// store the number of elements in each array
lpcaStringsOut->cElems = ulElems;
lpcaCookiesOut->cElems = ulElems;
// allocate the strings
lpcaStringsOut->pElems[0] = (LPOLESTR)::CoTaskMemAlloc((lstrlen(szvalue1) + 1) * 2);
lpcaStringsOut->pElems[1] = (LPOLESTR)::CoTaskMemAlloc((lstrlen(szvalue2) + 1) * 2);
MultiByteToWideChar(CP_ACP, 0, szvalue1, -1, lpcaStringsOut->pElems[0], (lstrlen(szvalue1) + 1) * 2);
MultiByteToWideChar(CP_ACP, 0, szvalue2, -1, lpcaStringsOut->pElems[1], (lstrlen(szvalue1) + 1) * 2);
// assign the cookie value
lpcaCookiesOut->pElems[0] = ivalue1;
lpcaCookiesOut->pElems[1] = ivalue2;
hResult = S_OK;
}
return hResult;
}
убрал дуратский макрос ATLA2WHELPER, и все равно пустота: