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. C / C++ / MFC
  4. out of memory

out of memory

Scheduled Pinned Locked Moved C / C++ / MFC
databaseperformancehelpannouncement
3 Posts 2 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.
  • S Offline
    S Offline
    SamirSood
    wrote on last edited by
    #1

    When I Insert the records into the database which contain files using the following code:- CSplit splt; HGLOBAL hGlobal; int m_r; tst.Open(CRecordset::dynamic); tst.AddNew(); tst.m_Split_ID ="128888211111"; CString m_strMid; m_r = f.GetLength(); hGlobal = GlobalAlloc(GPTR,m_r); tst.m_Split_Eng_Text.m_dwDataLength = m_r; tst.m_Split_Eng_Text.m_hData = GlobalLock(hGlobal); f.ReadHuge(tst.m_Split_Eng_Text.m_hData,m_r); tst.SetFieldDirty(&tst.m_Split_Eng_Text); tst.SetFieldNull(&tst.m_Split_Eng_Text,FALSE); tst.Update(); f.Close(); tst.Close(); But When I repeat the above lines of code It is giving me error as "Out of Memory" Can anyone suggest the solution for it Samir Sood

    J 1 Reply Last reply
    0
    • S SamirSood

      When I Insert the records into the database which contain files using the following code:- CSplit splt; HGLOBAL hGlobal; int m_r; tst.Open(CRecordset::dynamic); tst.AddNew(); tst.m_Split_ID ="128888211111"; CString m_strMid; m_r = f.GetLength(); hGlobal = GlobalAlloc(GPTR,m_r); tst.m_Split_Eng_Text.m_dwDataLength = m_r; tst.m_Split_Eng_Text.m_hData = GlobalLock(hGlobal); f.ReadHuge(tst.m_Split_Eng_Text.m_hData,m_r); tst.SetFieldDirty(&tst.m_Split_Eng_Text); tst.SetFieldNull(&tst.m_Split_Eng_Text,FALSE); tst.Update(); f.Close(); tst.Close(); But When I repeat the above lines of code It is giving me error as "Out of Memory" Can anyone suggest the solution for it Samir Sood

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      GlobalAlloc is fine, but when u finish with the allocated memory u should use GlobalFree Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

      S 1 Reply Last reply
      0
      • J jmkhael

        GlobalAlloc is fine, but when u finish with the allocated memory u should use GlobalFree Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

        S Offline
        S Offline
        SamirSood
        wrote on last edited by
        #3

        I have used the GlobalFree function but to no avail Samir Sood

        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