I have not much time yet, so I can't test it. Anyway, here are my suggestions:

In the first example you create a panel with a button function 'videopan'. But it isnt defined previously! Try to make a function prototype of videopan before 'firstpan'.

If this isnt working at all, try to use function pointers instead and fill them after engine start. I will test it later.

Cheers
Christian