Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to monitor the value at a specific address say 0x003b9c Pin
PJ Arends12-Mar-05 17:36
professionalPJ Arends12-Mar-05 17:36 
GeneralRe: How to monitor the value at a specific address say 0x003b9c Pin
tervalor12-Mar-05 19:45
tervalor12-Mar-05 19:45 
GeneralRe: How to monitor the value at a specific address say 0x003b9c Pin
humps12-Mar-05 20:11
humps12-Mar-05 20:11 
Questionhow to save complete web page on hard disk? Pin
arooj12-Mar-05 15:41
arooj12-Mar-05 15:41 
AnswerRe: how to save complete web page on hard disk? Pin
Mohsen Saad13-Mar-05 6:00
Mohsen Saad13-Mar-05 6:00 
GeneralMFC Grid Control Exception in Release Build Only! Pin
jarbus12-Mar-05 10:17
jarbus12-Mar-05 10:17 
GeneralRe: MFC Grid Control Exception in Release Build Only! Pin
PJ Arends12-Mar-05 17:41
professionalPJ Arends12-Mar-05 17:41 
GeneralRe: MFC Grid Control Exception in Release Build Only! Pin
jarbus13-Mar-05 9:02
jarbus13-Mar-05 9:02 
Here's the mapping of the message to the function in my view.
IDC_CUSTOM1 is obviously the MFC Grid Control.

I don't think the fact that this is a recordview rather than a standard
view makes a difference, but let me know if you think it makes a difference.

BEGIN_MESSAGE_MAP(CMyView, CRecordView)
ON_NOTIFY(NM_CLICK, IDC_CUSTOM1, OnGridClick)
ON_NOTIFY(NM_DBLCLK,IDC_CUSTOM1, OnGridDblClick)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()


I added this public function to the gridctrl class (in gridctrl.h) to enable my view
to retrieve which cell was clicked

CCellID GetLeftClickDownCell()const {return m_LeftClickDownCell;}


Here's the actual message handler:

void CMyView::OnGridClick()
{
int r = m_grid.GetLeftClickDownCell().row; //MY FUNCTION CALL
int c = m_grid.GetLeftClickDownCell().col;

if (!c && r)
HandleDblClickColZero(r,true);

return;
}


HandleDblClickColZero does a bunch of stuff with the data from that grid cell - or does nothing at all - it doesn't matter which - It gets fully executed, OnGridclick is fully executed AND THEN the following error comes up (regardless of whether HandleDblClickColZero even gets called by the if statement):

Unhandled exception in MyProgram.exe 0xC0000005:Access Violation

All I can do is tie the access violation to the grid control, but how or why I am at a loss for!




<-j->
GeneralRe: MFC Grid Control Exception in Release Build Only! Pin
PJ Arends13-Mar-05 10:58
professionalPJ Arends13-Mar-05 10:58 
GeneralRe: MFC Grid Control Exception in Release Build Only! Pin
PJ Arends13-Mar-05 11:10
professionalPJ Arends13-Mar-05 11:10 
GeneralC++ Dll Pin
Daniel Kanev12-Mar-05 9:53
Daniel Kanev12-Mar-05 9:53 
GeneralRe: C++ Dll Pin
YaronNir12-Mar-05 11:25
YaronNir12-Mar-05 11:25 
GeneralRe: C++ Dll Pin
John R. Shaw12-Mar-05 13:14
John R. Shaw12-Mar-05 13:14 
GeneralInheritance & Derived Classes Pin
tnvols12-Mar-05 9:48
tnvols12-Mar-05 9:48 
GeneralRe: Inheritance &amp; Derived Classes Pin
tnvols12-Mar-05 13:01
tnvols12-Mar-05 13:01 
Questionhow to communicate with a web site Pin
Mohsen Saad12-Mar-05 6:43
Mohsen Saad12-Mar-05 6:43 
AnswerRe: how to communicate with a web site Pin
Ravi Bhavnani12-Mar-05 10:14
professionalRavi Bhavnani12-Mar-05 10:14 
GeneralWin32 API and FindWindow Pin
3Dizard12-Mar-05 5:19
3Dizard12-Mar-05 5:19 
GeneralRe: Win32 API and FindWindow Pin
Mohsen Saad13-Mar-05 6:05
Mohsen Saad13-Mar-05 6:05 
GeneralRe: Win32 API and FindWindow Pin
David Crow14-Mar-05 5:59
David Crow14-Mar-05 5:59 
Generallinking of vc++ program to another vc++ prog Pin
mhay_nineteen@yahoo.com12-Mar-05 0:51
sussmhay_nineteen@yahoo.com12-Mar-05 0:51 
GeneralRe: linking of vc++ program to another vc++ prog Pin
deldeep12-Mar-05 1:17
deldeep12-Mar-05 1:17 
Questiondll problem? Pin
murali_utr11-Mar-05 23:26
murali_utr11-Mar-05 23:26 
AnswerRe: dll problem? Pin
YaronNir12-Mar-05 11:28
YaronNir12-Mar-05 11:28 
GeneralPlease help, i got problem with memory allocation Pin
Rassul Yunussov11-Mar-05 22:58
Rassul Yunussov11-Mar-05 22:58 

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.