out of memory
-
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
-
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
-
GlobalAlloc is fine, but when u finish with the allocated memory u should use GlobalFree Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;