For those interested in the changes made to GTK-Server for ScriptBasic, here is the code.
#ifdef GTK_SERVER_SCRIPTBASIC
besVERSION_NEGOTIATE
return (int)INTERFACE_VERSION;
besEND
besSUB_START
besEND
besSUB_FINISH
besEND
besFUNCTION(_idll)
VARIABLE ptr;
char* arg0;
char* retstr;
if(besARGNR>1) return EX_ERROR_TOO_MANY_ARGUMENTS;
if(besARGNR<1) return EX_ERROR_TOO_FEW_ARGUMENTS;
ptr = besARGUMENT(1);
besDEREFERENCE(ptr);
arg0 = besCONVERT2ZCHAR(besCONVERT2STRING(ptr),arg0);
retstr = (char*)gtk(arg0);
besALLOC_RETURN_STRING(strlen(retstr));
memcpy(STRINGVALUE(besRETURNVALUE),retstr,strlen(retstr));
besFREE(arg0);
besEND
besFUNCTION(varptr)
VARIABLE ptr;
if(besARGNR>1) return EX_ERROR_TOO_MANY_ARGUMENTS;
if(besARGNR<1) return EX_ERROR_TOO_FEW_ARGUMENTS;
besALLOC_RETURN_LONG
ptr = besARGUMENT(1);
besDEREFERENCE(ptr);
LONGVALUE(besRETURNVALUE) = (int)ptr;
besEND
besFUNCTION(_idll_require)
VARIABLE ptr;
char* arg0;
char* retstr;
char sb_require[64];
strcpy (sb_require,"gtk_server_require ");
if(besARGNR>1) return EX_ERROR_TOO_MANY_ARGUMENTS;
if(besARGNR<1) return EX_ERROR_TOO_FEW_ARGUMENTS;
ptr = besARGUMENT(1);
besDEREFERENCE(ptr);
arg0 = besCONVERT2ZCHAR(besCONVERT2STRING(ptr),arg0);
strcat (sb_require,arg0);
retstr = (char*)gtk(sb_require);
besALLOC_RETURN_STRING(strlen(retstr));
memcpy(STRINGVALUE(besRETURNVALUE),retstr,strlen(retstr));
besFREE(arg0);
besEND
besFUNCTION(_idll_define)
VARIABLE ptr;
char* arg0;
char* retstr;
char sb_define[256];
strcpy (sb_define,"gtk_server_define ");
if(besARGNR>1) return EX_ERROR_TOO_MANY_ARGUMENTS;
if(besARGNR<1) return EX_ERROR_TOO_FEW_ARGUMENTS;
ptr = besARGUMENT(1);
besDEREFERENCE(ptr);
arg0 = besCONVERT2ZCHAR(besCONVERT2STRING(ptr),arg0);
strcat (sb_define,arg0);
retstr = (char*)gtk(sb_define);
besALLOC_RETURN_STRING(strlen(retstr));
memcpy(STRINGVALUE(besRETURNVALUE),retstr,strlen(retstr));
besFREE(arg0);
besEND
/* Needed to compile standalone Scriptbasic programs */
SLFST VISIO_SLFST[] = {
{"versmodu", versmodu},
{"bootmodu", bootmodu},
{"finimodu", finimodu},
{"_idll", _idll},
{"varptr",varptr},
{"_idll_require", _idll_require},
{"_idll_define", _idll_define},
{NULL, NULL}
};
#endif /* End of ScriptBasic code */