Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.5-Jan-09 22:49
Radhakrishnan G.5-Jan-09 22:49 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Cedric Moonen5-Jan-09 23:07
Cedric Moonen5-Jan-09 23:07 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Jijo.Raj5-Jan-09 23:11
Jijo.Raj5-Jan-09 23:11 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. [modified] Pin
Radhakrishnan G.5-Jan-09 23:29
Radhakrishnan G.5-Jan-09 23:29 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Jijo.Raj6-Jan-09 0:08
Jijo.Raj6-Jan-09 0:08 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Naveen6-Jan-09 0:01
Naveen6-Jan-09 0:01 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.6-Jan-09 0:21
Radhakrishnan G.6-Jan-09 0:21 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Stuart Dootson6-Jan-09 0:44
professionalStuart Dootson6-Jan-09 0:44 
I know you've fixed your problem - just a comment on style. Why not use a locally declared CHOOSECOLOR rather than one on the heap? That way, you don't need to remember to delete it.

Your (fixed) code would look like this:

CHOOSECOLOR stChooseColor = { 0 };
COLORREF     crCustomColorArray[ 16 ] = { 0 };
stChooseColor.Flags       = CC_RGBINIT;
stChooseColor.lStructSize = sizeof( CHOOSECOLOR );
stChooseColor.hwndOwner   = m_hWnd;
stChooseColor.lpCustColors = crCustomColorArray;  // Custom color array stChooseColor.rgbResult   = ConfigMgr::Instance().GetBkColor();
if( FALSE != ChooseColor( &stChooseColor ))
{
  // Update the Background color.
  ConfigMgr::Instance().SetBkColor( *stChooseColor.lpCustColors );
}


I know it's not a big change, but using the stack for variable storage when possible makes memory management so much easier Smile | :)

One other thing - doesn't ChooseColor pass back the user's selected color in the rgbResult member, rather than in lpCustColors[0], as you've used? That's what the documentation[^] says, anyway.
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.6-Jan-09 4:02
Radhakrishnan G.6-Jan-09 4:02 
QuestionCreateSerivce get stuck for 2.5 minutes Pin
Green Fuze5-Jan-09 22:00
Green Fuze5-Jan-09 22:00 
AnswerRe: CreateSerivce get stuck for 2.5 minutes Pin
Randor 6-Jan-09 19:16
professional Randor 6-Jan-09 19:16 
QuestionHow to retrieve drive letter of a USB device from WMI for a given DeviceID Pin
Subrat Patnaik5-Jan-09 21:34
Subrat Patnaik5-Jan-09 21:34 
AnswerRe: How to retrieve drive letter of a USB device from WMI for a given DeviceID Pin
Sarath C5-Jan-09 21:41
Sarath C5-Jan-09 21:41 
AnswerRe: How to retrieve drive letter of a USB device from WMI for a given DeviceID Pin
Hamid_RT5-Jan-09 21:52
Hamid_RT5-Jan-09 21:52 
Questionhow to get installed font list of Windows XP?? Pin
vijay.victory5-Jan-09 20:32
vijay.victory5-Jan-09 20:32 
AnswerRe: how to get installed font list of Windows XP?? Pin
Naveen5-Jan-09 20:46
Naveen5-Jan-09 20:46 
GeneralRe: how to get installed font list of Windows XP?? Pin
Hamid_RT5-Jan-09 20:54
Hamid_RT5-Jan-09 20:54 
GeneralRe: how to get installed font list of Windows XP?? Pin
Naveen5-Jan-09 20:59
Naveen5-Jan-09 20:59 
GeneralRe: how to get installed font list of Windows XP?? Pin
Cedric Moonen5-Jan-09 21:13
Cedric Moonen5-Jan-09 21:13 
GeneralRe: how to get installed font list of Windows XP?? Pin
Naveen5-Jan-09 21:20
Naveen5-Jan-09 21:20 
GeneralRe: how to get installed font list of Windows XP?? Pin
Hamid_RT5-Jan-09 21:24
Hamid_RT5-Jan-09 21:24 
GeneralRe: how to get installed font list of Windows XP?? Pin
Hamid_RT5-Jan-09 21:25
Hamid_RT5-Jan-09 21:25 
JokeRe: how to get installed font list of Windows XP?? Pin
Iain Clarke, Warrior Programmer5-Jan-09 21:51
Iain Clarke, Warrior Programmer5-Jan-09 21:51 
GeneralRe: how to get installed font list of Windows XP?? Pin
Hamid_RT5-Jan-09 21:56
Hamid_RT5-Jan-09 21:56 
GeneralRe: how to get installed font list of Windows XP?? Pin
Mark Salsbery6-Jan-09 5:30
Mark Salsbery6-Jan-09 5:30 

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.