Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Any other C++ forum?? Pin
Anonymous26-Oct-02 19:09
Anonymous26-Oct-02 19:09 
AnswerRe: Any other C++ forum?? Pin
Christian Graus26-Oct-02 21:09
protectorChristian Graus26-Oct-02 21:09 
GeneralLoadImage... Out of Memory!! HELP! Pin
devvvy26-Oct-02 14:12
devvvy26-Oct-02 14:12 
GeneralRe: LoadImage... Out of Memory!! HELP! Pin
Michael Dunn26-Oct-02 18:31
sitebuilderMichael Dunn26-Oct-02 18:31 
GeneralRe: LoadImage... Out of Memory!! HELP! Pin
devvvy28-Oct-02 11:20
devvvy28-Oct-02 11:20 
GeneralProblem with CreateThread memory allocation Pin
devvvy26-Oct-02 13:10
devvvy26-Oct-02 13:10 
GeneralRe: Problem with CreateThread memory allocation Pin
Neville Franks26-Oct-02 13:42
Neville Franks26-Oct-02 13:42 
GeneralRe: Problem with CreateThread memory allocation Pin
devvvy26-Oct-02 14:19
devvvy26-Oct-02 14:19 
Thanks for the feedback first of all. LoadImage return a BITMAP hBitmap which is stored in a variable (of type BITMAP of course) in the "thread function". The images sequence is stored in a CBitmap array in the document class, which is separate from the thread... so, all I need is just enuf memory for ONE bitmap (700kB), and yes 10MB is an overkill, but I really dont understand why LoadImage results in memory error:

long WINAPI LoadFrames(LPARAM lparam)
{ //*

CString sPath;
HBITMAP hBitmap = NULL;

CAutoPlayMFCDoc * pDoc = NULL;

pDoc = (CAutoPlayMFCDoc*) lparam;

//Load the rest of the frames!
for(int i=NUM_PRELOAD; i<num_bitmap; i++)
="" {="" **

="" spath="pDoc-">GetPath();
if( sPath.GetLength() > 0 )
{ //***

hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), sPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );

if( hBitmap != NULL)
{
pDoc->GetBitmapSeq(i).Attach(hBitmap);
}
else
{
//That's the problem: dwError==8 implies "ERROR_NOT_ENOUGH_MEMORY"
DWORD dwError = GetLastError();
pDoc->SetLoadState(1);
i = i -1; //reload the frame
break;
}

//Increment m_nTargetDocFrame:
pDoc->SetTargetDocFrame(i);

} //***
} //**

return 1;

} //*



norm
GeneralRe: Problem with CreateThread memory allocation Pin
Neville Franks26-Oct-02 14:41
Neville Franks26-Oct-02 14:41 
GeneralRe: Problem with CreateThread memory allocation Pin
devvvy26-Oct-02 14:50
devvvy26-Oct-02 14:50 
GeneralRe: Problem with CreateThread memory allocation Pin
Neville Franks26-Oct-02 14:59
Neville Franks26-Oct-02 14:59 
GeneralRe: Problem with CreateThread memory allocation Pin
devvvy26-Oct-02 15:08
devvvy26-Oct-02 15:08 
GeneralMSHTML Table Insertion using CHtmlEditView Pin
Member 5194326-Oct-02 12:25
Member 5194326-Oct-02 12:25 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Anonymous26-Oct-02 13:30
Anonymous26-Oct-02 13:30 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Stephane Rodriguez.26-Oct-02 18:07
Stephane Rodriguez.26-Oct-02 18:07 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Member 5194326-Oct-02 19:26
Member 5194326-Oct-02 19:26 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Stephane Rodriguez.26-Oct-02 19:45
Stephane Rodriguez.26-Oct-02 19:45 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Member 5194327-Oct-02 6:01
Member 5194327-Oct-02 6:01 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Stephane Rodriguez.27-Oct-02 7:04
Stephane Rodriguez.27-Oct-02 7:04 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Member 5194327-Oct-02 9:14
Member 5194327-Oct-02 9:14 
GeneralThanks for help to includeh10 Chris Losinger Pin
Svin26-Oct-02 12:16
Svin26-Oct-02 12:16 
GeneralDword usage Pin
J. Schermerhorn26-Oct-02 12:15
J. Schermerhorn26-Oct-02 12:15 
GeneralRe: Dword usage Pin
Anders Molin26-Oct-02 12:19
professionalAnders Molin26-Oct-02 12:19 
GeneralRe: Dword usage Pin
Chris Losinger26-Oct-02 12:20
professionalChris Losinger26-Oct-02 12:20 
GeneralRe: Dword usage Pin
Paul M Watt26-Oct-02 19:39
mentorPaul M Watt26-Oct-02 19:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.