Invalid Conversion (C++ question)
Posted: Wed Apr 26, 2006 12:16 pm
I've got this here code (C++, Allegro and AGUP for the GUI) that's an utter bastard to get to work.
What it does while compiling, is giving this error message:
Code: Select all
int translate()
{
alert("You pushed my button!", "Isn't this a useful feature?", 0,
"&Yes", "&Definitely", 'y', 'd');
return D_O_K;
}
(...)
DIALOG main_dlg[] =
{
/* (dialog proc) (x) (y) (w) (h) (fg)(bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
/* this element just clears the screen, therefore it should come before the others */
{ d_agup_clear_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL },
{ d_agup_edit_proc, 100, 75, 160, 8, 0, 0, 0, 0, LENGTH, 0, word_1, NULL, NULL },
{ d_agup_push_proc, 100, 95, 100, 20, 0, 0, 0, 0, 0, 0, str_trans, 0, translate },
{ quit_proc, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0 },
/* the next two elements don't draw anything */
{ d_yield_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL },
{ NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
It points to the main_dlg declaration, and seems to be caused by the d_agup_push_proc part.invalid conversion from `int (*)()' to `void*'