Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Atl Server - CBlobCache

Atl Server - CBlobCache

Scheduled Pinned Locked Moved ATL / WTL / STL
c++sysadminhelpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rbeckett
    wrote on last edited by
    #1

    I'm having difficulty using ATL Server's CBlobCache class. I'm trying to add an entry to the blob cache. The key is "v1" and the value is an int. The add method takes a *void for the actual data, so I figured I could push an int into it. Unfortunately, the mout int reads 6,500,000 . Is it a problem with my implementation of m_spBlobCache->Add or m_spBlobCache->GetData ? HCACHEITEM hEntry; // Get the IMemoryCache service from the ISAPI extension if (FAILED(m_spServiceProvider->QueryService(__uuidof(IMemoryCache), &m_spBlobCache))) return HTTP_FAIL; HRESULT hr = m_spBlobCache->LookupEntry("v1", &hEntry); if (FAILED(hr) || !hEntry) { static const int s7 = 1; int *pData = (int *)malloc(sizeof(int)); if (!pData) return HTTP_FAIL; *pData = s7; CFileTime ft = CFileTime::GetCurrentTime() + CFileTime::Minute; if(FAILED(m_spBlobCache->Add("v1", pData, (DWORD)sizeof(int), &ft, m_hInstHandler, &hEntry, &g_MemoryCacheClient))) { m_spBlobCache->ReleaseEntry(hEntry); return HTTP_FAIL; } } if(FAILED(m_spBlobCache->GetData(hEntry, (void**)&mout, &dwSize))) { m_spBlobCache->ReleaseEntry(hEntry); return HTTP_FAIL; } TIA Ryan

    R 1 Reply Last reply
    0
    • R rbeckett

      I'm having difficulty using ATL Server's CBlobCache class. I'm trying to add an entry to the blob cache. The key is "v1" and the value is an int. The add method takes a *void for the actual data, so I figured I could push an int into it. Unfortunately, the mout int reads 6,500,000 . Is it a problem with my implementation of m_spBlobCache->Add or m_spBlobCache->GetData ? HCACHEITEM hEntry; // Get the IMemoryCache service from the ISAPI extension if (FAILED(m_spServiceProvider->QueryService(__uuidof(IMemoryCache), &m_spBlobCache))) return HTTP_FAIL; HRESULT hr = m_spBlobCache->LookupEntry("v1", &hEntry); if (FAILED(hr) || !hEntry) { static const int s7 = 1; int *pData = (int *)malloc(sizeof(int)); if (!pData) return HTTP_FAIL; *pData = s7; CFileTime ft = CFileTime::GetCurrentTime() + CFileTime::Minute; if(FAILED(m_spBlobCache->Add("v1", pData, (DWORD)sizeof(int), &ft, m_hInstHandler, &hEntry, &g_MemoryCacheClient))) { m_spBlobCache->ReleaseEntry(hEntry); return HTTP_FAIL; } } if(FAILED(m_spBlobCache->GetData(hEntry, (void**)&mout, &dwSize))) { m_spBlobCache->ReleaseEntry(hEntry); return HTTP_FAIL; } TIA Ryan

      R Offline
      R Offline
      rbeckett
      wrote on last edited by
      #2

      Stupid Me... This code is correct, I just messed up the request handling part. Well, now if anyone wants to know how to write an int to CBlobCache, they can use this snippet... Ryan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups