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

C / C++ / MFC

 
GeneralRe: adding an image Pin
Mel Feik27-Oct-02 8:28
Mel Feik27-Oct-02 8:28 
QuestionAny other C++ forum?? Pin
vishwadev26-Oct-02 15:09
vishwadev26-Oct-02 15:09 
AnswerRe: Any other C++ forum?? Pin
Mel Feik26-Oct-02 15:59
Mel Feik26-Oct-02 15:59 
GeneralRe: Any other C++ forum?? Pin
vishwadev26-Oct-02 16:30
vishwadev26-Oct-02 16:30 
AnswerRe: Any other C++ forum?? Pin
David Gao26-Oct-02 16:09
David Gao26-Oct-02 16:09 
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 
hi, i've written a simple application that display a sequence of bitmap in the VIEw of a MFC/SDI application.

There're four components to the implementation:
(1) timer itselg
(2) View_Class::OnTimer(..)
{

Invalidate(); //Trigger View_Class::OnDraw()
(3) View_Class::OnDraw(..) is responsible for rendering the bitmaps to screen.
(4) Document class - handles all bitmap loading

(4a) Constructor:
STEP 1: Pre-load a few frames
STEP 2: launch a thread - LoadFrames( ) - that load the rest of the bitmap sequence.

hThread = CreateThread( NULL, 10000000, (LPTHREAD_START_ROUTINE) LoadFrames, this, 0, &nThreadID);

As you can see, I did allocated 10MB worth of memory here!

STEP 3: set timer


(4b) LoadFrames( ) //This method loads a bunch of frames to document class
{

//ERROR!!
hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), sPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
if( hBitmap != NULL)
{
pDoc->GetBitmapSeq(i).Attach(hBitmap);
}
else
{
//Out of memory?!?! NOTE: dwError==8 implies "ERROR_NOT_ENOUGH_MEMORY"
//System monitor shows that the thread never had more than 2.5MB!??! How can it run out of memory??
DWORD dwError = GetLastError();
}
}

Thanks

norm
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 
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 

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.