Having trouble to call an event handler directly from my code. I found the same question 2 years ago here. original question
But the line
me_InsertCommentText(wxCo
wxCommandEvent() is a temporary object, which couldn't be bound to non-const reference. You could use named variable here:
wxCommandEvent event;
me_InsertCommentText(event);
or change the type of parameter to const reference:
void mjpgen_wdDialog::me_InsertCommentText(const wxCommandEvent&)
then
me_InsertCommentText(wxCommandEvent());