Windows XP Home SP3
PowerBASIC Win 9
I used the PB COM Browser to generate an INClude file for SAPI (Microsoft Speech). When I created a small program and attemptd to compile it, it gave numerous errors in reference to undefined TYPEs. It turns out that an item within a TYPE would be TYPE (defined later in the INC). I copied and pasted these above the original TYPE and it solved that problem.
With that solved, I tried to work on the speech recognition (which I've got working in PB8), but I'm having problems with ISpeechRecoContext. It turns out that oRecoContext never obtains a value and always errors out. I tried messing around with it for an hour or two and then tried some of the other interfaces and found out they worked as expected. Can anyone advise what may be causing this? PB8 works as expected. PB9 accesses SAPI's other keywords as expected. I'm stuck.
SAPI.INC (header of SAPI.INC [created via PB COM Browser])
SAPI.BAS
PowerBASIC Win 9
I used the PB COM Browser to generate an INClude file for SAPI (Microsoft Speech). When I created a small program and attemptd to compile it, it gave numerous errors in reference to undefined TYPEs. It turns out that an item within a TYPE would be TYPE (defined later in the INC). I copied and pasted these above the original TYPE and it solved that problem.
With that solved, I tried to work on the speech recognition (which I've got working in PB8), but I'm having problems with ISpeechRecoContext. It turns out that oRecoContext never obtains a value and always errors out. I tried messing around with it for an hour or two and then tried some of the other interfaces and found out they worked as expected. Can anyone advise what may be causing this? PB8 works as expected. PB9 accesses SAPI's other keywords as expected. I'm stuck.
SAPI.INC (header of SAPI.INC [created via PB COM Browser])
Code:
' Library Name: SpeechLib ' Library File: C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll ' Description : Microsoft Speech Object Library ' GUID : {C866CA3A-32F7-11D2-9602-00C04F8EE628} ' LCID : 0 ' Version : 5.0
Code:
#COMPILE EXE #DIM ALL #INCLUDE "Win32API.INC" #INCLUDE "SAPI.INC" FUNCTION PBMAIN () AS LONG DIM oObjectToken AS ISpeechObjectToken DIM oRecoContext AS ISpeechRecoContext 'Added later for testing. oObjectToken = NEWCOM $PROGID_SpObjectToken IF ISFALSE ( ISOBJECT ( oObjectToken ) ) THEN MSGBOX "oObjectToken ERROR" : EXIT FUNCTION 'Original Interest oRecoContext = NEWCOM $PROGID_SpSharedRecoContext IF ISFALSE ( ISOBJECT ( oRecoContext ) ) THEN MSGBOX "oRecoContext ERROR" : EXIT FUNCTION END FUNCTION
Comment