On jeudi 19 juin 2008, Marcos Antonio Pandolfo Jr wrote: > Hi > > Im using Centos 5 and Gambas 2.0.0 and when I call a external function in > a C library this error occurs and Gambas crash with error #6.... > > EXTERN TEF_inicia(Resultado AS String, Funcao AS String, Valor AS String, > CuponFiscal AS String, DataFiscal AS String, Horario AS String, Operador AS > String, ParamAdic AS String) IN "libclisitef" EXEC > "IniciaFuncaoSiTefInterativoA" > > DIM la AS String > TEF_inicia(la, "000000", "{200,00}", "{12345}", "20080618", "100000", > "{MARCOS}", "{}") > The variable "la" receive the return from function TEF_inicia. >
You incorrectly use the extern function. Did you read the documentation about EXTERN declaration on the wiki? If the first argument of the called function is a 'char **', you cannot declare it as String. You must allocate some memory and send the pointer to this allocation. I will post an example on the wiki page. Regards, -- Benoit Minisini ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user