Click here to Skip to main content
15,903,854 members
Home / Discussions / Mobile
   

Mobile

 
GeneralDatatype Misalignment exception Pin
nigs_krec2-Dec-03 22:10
nigs_krec2-Dec-03 22:10 
GeneralRe: Datatype Misalignment exception Pin
nigs_krec3-Dec-03 22:08
nigs_krec3-Dec-03 22:08 
GeneralRe: Datatype Misalignment exception Pin
nigs_krec4-Dec-03 0:27
nigs_krec4-Dec-03 0:27 
GeneralRe: Datatype Misalignment exception Pin
João Paulo Figueira4-Dec-03 2:09
professionalJoão Paulo Figueira4-Dec-03 2:09 
GeneralSQL Server CE 2.0 installation on Emulator Pin
nigs_krec2-Dec-03 19:29
nigs_krec2-Dec-03 19:29 
GeneralRe: SQL Server CE 2.0 installation on Emulator Pin
João Paulo Figueira3-Dec-03 3:56
professionalJoão Paulo Figueira3-Dec-03 3:56 
GeneralNotification API Pin
bdeberny2-Dec-03 4:04
bdeberny2-Dec-03 4:04 
GeneralThings you should know!! Pin
GDavy2-Dec-03 3:46
GDavy2-Dec-03 3:46 
I would like to mention this to you fellow programmers who program for Pocket PC`s.
My last project concerned an application that I wrote for a device on MIPS platform and ARM, I developed using emBedded C++ 3.0 for the MIPS, and embeddedC++4.0 for the ARM. It was a dialog based application and almost all dialogs were created dynamicaly when needed. What happened now is that there seemed to be a big memory leak.
Checking the code revealed nothing. Everywhere dynamically created objects and arrays were correctly deleted. The few brushes that were created with CreateSolidBrush were all deleted with DeleteObject at the correct time. It was very bizarre.
However, I did find a way to get rid of the memory leak! That^s what I want to inform you about.
What I did was everywhere where I called DeleteObject on the CBrush objects I replaced the call with

HGDIOBJ HObj = m_Brush.Detach(); //m_Brush is CBrush object previously created with
//m_Brush.CreateSolidBrush(ACOLOR);
if(HObj)
::DeleteObject(HObj);

This replacement got rid of the memory leak. I do not know why the DeleteObject of the CGDIObject class did not do it, maybe it is Project setting I overlooked, but if that is the case, damn, pretty bizarre to need a proj setting for the delete member func while the create works just fine.
If it is a 'bug' in MFC on these platforms I hope that with this post some future programmers are saved from some serious annoying almost untraceable mem-leak search!

(I assume the same will happen for CPen, and other from CGDIObject derived classes. so this little replacement might save you some mem-leaks)

Greetings to you all,
Davy

GeneralRe: Things you should know!! Pin
João Paulo Figueira2-Dec-03 4:14
professionalJoão Paulo Figueira2-Dec-03 4:14 
GeneralRe: Things you should know!! Pin
GDavy2-Dec-03 4:23
GDavy2-Dec-03 4:23 
GeneralNot able to connect to ppc 2003 emulator Pin
nigs_krec1-Dec-03 20:25
nigs_krec1-Dec-03 20:25 
GeneralMemory leak Pin
GDavy30-Nov-03 20:23
GDavy30-Nov-03 20:23 
GeneralRe: Memory leak Pin
João Paulo Figueira1-Dec-03 4:25
professionalJoão Paulo Figueira1-Dec-03 4:25 
GeneralRe: Memory leak Pin
GDavy2-Dec-03 3:54
GDavy2-Dec-03 3:54 
GeneralProblem with CDC and Timer Pin
Rassul Yunussov28-Nov-03 4:23
Rassul Yunussov28-Nov-03 4:23 
GeneralRe: Problem with CDC and Timer Pin
João Paulo Figueira28-Nov-03 11:04
professionalJoão Paulo Figueira28-Nov-03 11:04 
GeneralRe: Problem with CDC and Timer Pin
Rassul Yunussov28-Nov-03 20:21
Rassul Yunussov28-Nov-03 20:21 
GeneralRe: Problem with CDC and Timer Pin
João Paulo Figueira30-Nov-03 5:58
professionalJoão Paulo Figueira30-Nov-03 5:58 
GeneralFile Open dialog in eVC ! Pin
nigs_krec26-Nov-03 1:25
nigs_krec26-Nov-03 1:25 
GeneralRe: File Open dialog in eVC ! Pin
João Paulo Figueira26-Nov-03 2:16
professionalJoão Paulo Figueira26-Nov-03 2:16 
GeneralRe: File Open dialog in eVC ! Pin
nigs_krec28-Nov-03 3:03
nigs_krec28-Nov-03 3:03 
GeneralRe: File Open dialog in eVC ! Pin
João Paulo Figueira28-Nov-03 3:24
professionalJoão Paulo Figueira28-Nov-03 3:24 
GeneralRe: File Open dialog in eVC ! Pin
nigs_krec28-Nov-03 3:38
nigs_krec28-Nov-03 3:38 
GeneralRe: File Open dialog in eVC ! Pin
João Paulo Figueira28-Nov-03 3:50
professionalJoão Paulo Figueira28-Nov-03 3:50 
GeneralRe: File Open dialog in eVC ! Pin
Atif Mushtaq11-Dec-03 19:42
Atif Mushtaq11-Dec-03 19:42 

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.