headers in C and freebasic?

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
maurosebastian91
Posts: 30
Joined: Mar 21, 2021 18:22

headers in C and freebasic?

Post by maurosebastian91 »

Hello colleagues, good morning.

I'm here today to ask for your help with a small translation of a C header, an interface for the JAWS screen reader.
there are two or three functions, one to pass it a string to make it talk, and the other to make it crash.
I was reading the wiki on how to translate C headers, but I really don't know if I did it right, because I add it to my application, but three or four times of calling the same function, the program crashes, I don't understand why.
I also passed the exe through the GDB but it only tells me that the program is closed normally, when none of that happens in the c++ compilations.

Could you please look at the .bi I wrote and the .h and tell me where I went wrong?
because I'm pretty sure the problem is there.
Here I uploaded the file with the dll and the .bi, the .h, the .lib and the c++ sample that came with what I downloaded.

https://www.mediafire.com/file/oj07wh6e ... i.zip/file

From already thank you very much,
Greetings.
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: headers in C and freebasic?

Post by grindstone »

Without having tested it, translated to the best of my knowledge:

Code: Select all

#Inclib "jfwapi"
#Ifndef JFWAPI_H_INCLUDED
	#define JFWAPI_H_INCLUDED
	#Ifndef JFWAPI
		#define JFWAPI __declspec(dllimport)
	#EndIf
	Extern "c"
	Declare Sub JFWRunScript (ByVal lpszScriptName As ZString Ptr)
	Declare Function JFWSayString(ByVal cadena As ZString Ptr, ByVal bInterrupt As boolean) As boolean
	Declare Function JFWStopSpeech() As boolean
	End Extern
#EndIf
maurosebastian91
Posts: 30
Joined: Mar 21, 2021 18:22

Re: headers in C and freebasic?

Post by maurosebastian91 »

grindstone wrote: Aug 08, 2022 10:56 Without having tested it, translated to the best of my knowledge:

Code: Select all

#Inclib "jfwapi"
#Ifndef JFWAPI_H_INCLUDED
	#define JFWAPI_H_INCLUDED
	#Ifndef JFWAPI
		#define JFWAPI __declspec(dllimport)
	#EndIf
	Extern "c"
	Declare Sub JFWRunScript (ByVal lpszScriptName As ZString Ptr)
	Declare Function JFWSayString(ByVal cadena As ZString Ptr, ByVal bInterrupt As boolean) As boolean
	Declare Function JFWStopSpeech() As boolean
	End Extern
#EndIf
Thank you very much mate for your answer, but the same thing keeps happening to me, after calling the function to speak about three or four times, my program crashes.
Post Reply