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?