Problem in creating multilingual photon application

I have created a window in PhAB with some labels for which I have generated two language databases in English and German. On a button click by attaching the following callback function, I want to display the German strings:

int
translate( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )

{

  ApDBase_t *mydbase;
  setenv ("ABLPATH", "C:/LangTrans/LangTrans.de_DE", 1);
  setenv ("ABLANG", "de_DE", 1);
  widget = widget, apinfo = apinfo, cbinfo = cbinfo;
  mydbase = ApOpenDBaseFile( "C:/LangTrans/LangTrans.de_DE" );
  ApSetTranslation( "de_DE" );
  ApAppendTranslation( "LangTrans", "de_DE" );
  text = ApGetTextRes( mydbase, "lbl" );
  return( Pt_CONTINUE );

}

My application compiles correctly and the window is displayed successfully but as soon as I click on the button, it gives me "Memory Fault (core dumped) error. Can someone tell me what is wrong?

Hi

I am not that used to Photon, but when you post things like this it would be much easier to help you if you debug your application and tell us at what line it crashes!

Code is good, code is always good, but you need to be a little more specific, I am not able to test your code, but maybe someone else have that time . . .

Thanks