Member functions need qualifiers in order for the compiler to know which function your code refers to. In the case of a static function the qualifer must be the class name, since static functions belong to the class: hence Class::Function(). For member functions the qualifer must be the instance reference, as non-static functions are attached to individual objects: hence object.Function() or objectpointer->Function().
Which line does it occur on when you step through it, and what is the assertion being hit?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
I have a dialog based MFC application that I am rewriting in VS2010 from its original VC++ 6.0 source. Everything works fine in VC++ 6.0
The main dialog contains many child dialogs (not pop-ups) in which one child dialog is used to draw a plot based on the values sent from main dialog. The main dialog calls a function (Draw_Points) within the child dialog and the child dialog draws it and it does as long as the plot hits the edge and then it calls OnPaint message to refresh the dialog so that it can start afresh from left.
void CPlotDlg::Draw_Points(double value1, double value2)
if(m_LastPoint1.x < (m_time_rect.right-2))
// Store the data for later retrieval
m_CurrentPoint1.x = m_LastPoint1.x + 1;
m_CurrentPoint2.x = m_LastPoint2.x + 1;
// Do some calculations
m_Data1[m_DataCounter] = value1;
m_Data2[m_DataCounter++] = value2;
CWnd *Ctrl = GetDlgItem(IDE_PLOTS);
CDC *cdc = Ctrl->GetDC();
HGDIOBJ original = NULL;
original = cdc->SelectObject(GetStockObject(DC_PEN));
m_LastPoint1 = m_CurrentPoint1;
m_LastPoint2 = m_CurrentPoint2;
CPaintDC dc(this); // device context for painting// TODO: Add your message handler code hereif(m_BUpdate)
CWnd *Ctrl = GetDlgItem(IDE_PLOTS);
// Do not call CDialogEx::OnPaint() for painting messages
It crashes when the Draw_points function calls OnPaint function in its else section, and when OnPaint() function executes CPaintDC dc(this);
Well, you need to rethink your design. You should collect all the information related to the drawing as a result of user interaction, file processing etc. You then call InvalidateRect to tell Windows that your data has changed, and your window/client needs to be repainted. Then in the control you call your paint function in response to receiving a WM_PAINT message. It is at that point that you draw your lines, shapes, text etc.
Well, the first step is to create a query ( the easiest way would be to create it and test in the MS Access).
The second step - create the recordset that supports update and insert operations. See MSDN article [^] for details.
I am stumped again.
I have this macro which expect the parameter registerSAM to be a symbol , for example PIO_ODSR.
I like to pass such symbol to a function and just have no idea how to convert char* to such symbol.
The compiler is not much of a help, just flags an error.
I do not see any macro here, and I really cannot understand what all the above is supposed to do. It would really help, as I have suggested many times, if you showed the actual code clearly, and within <pre> tags so it is readable.
And I think you really do not know the answer and just wasting your time.
If you bother to follow the thread I did mention I tested it without the & and it did not work.
I suppose since I did not use code tags correctly it is my fault.
Thanks, go back to policing the posts. You do that very well.