VoiceGuide IVR Software Main Page
Jump to content

Dll Interaction

Recommended Posts

Hi

 

I have setup a dll to do some actions whitin a script. I'm applying the dll using the following code in a VBscript module

 

set vg = CreateObject("testDll.testfunct")

 

 

Do do this do I have to purchase an Enterprise version or is a professional ok?

 

The dll returns some values that I'll use within the rest of the script as vars,

does the system take into the returned values in a basic vars?

 

 

thank you

Mh

 

 

Share this post


Link to post

The Professional version can run VBScripts.

 

To return data from VBScript back to VoiceGuide you can either use the Result Files or VoiceGuide's COM functions. From http://www.voiceguide.com/vghelp/source/html/modvbs.htm :

VBScript can send responses back to VoiceGuide while it is executing by calling one VoiceGuide's ActiveX/COM functions. The functions which are considered to return a result back to VoiceGuide are: Run_ResultReturn(), Script_Gosub(), Script_Goto(), Script_Return(). For more information on VoiceGuide's ActiveX/COM interface please see the COM Interface section of Help file.

 

Once VoiceGuide detects that a VBScript has completed and no COM response was received beforehand then VoiceGuide will see if a "Result File" has been created by the script. If one has been created then VoiceGuide will read in it's contents and then determine what to do next based on the contents of the file.

 

The syntax of the Result File is the same as that used by the Run Program module. Please refer to the Run Program module Help file's section for more information.

 

A "Success" or Result Variable list must be returned to VoiceGuide (either though a Run_ResultReturn COM function or a Result File) in order for it to go down the Success path.

If no result is returned then the "Fail" path is taken after the VBScript completes.

Calls to Script_Gosub(), Script_Goto() and Script_Return() functions result in immediate running of the next module.

If you use VoiceGuide's COM functions then you will need to use the Enterprise version.

Share this post


Link to post

Sorry I'm a bit confused about VBscript / Com objects. I now that professionnal version allows to run VBscripts.

 

My question was more :

I'm using a VBscript to call my DLL functions (external dll that i written) . The dll returns to me some values thay I would like to use agin within the VG script.

 

Example of a VBscript that Im using

 

----------------------------------------------------------

set vg = CreateObject("Calendar.gCalendar")

dim checkk

checkk= vg.check("test")

set vg = Nothing

----------------------------------------------------------

 

 

I need the value of checkk to be used again in the VB script so do I need to use COM objects ?

 

Tkx

 

Mh

 

 

 

 

 

Share this post


Link to post

To return data back to VoiceGuide you can either:

 

A.

Create a Result File. VoiceGuide will then read in the Result File and the data contained in it and make any data in the result file available for use by remainder of the script. See: http://www.voiceguide.com/vghelp/source/ht...drunprogram.htm for specs on Result Files format. Some examples on how to write to a text from from VBScript are provided in Help file entry on Run VBScript module: http://www.voiceguide.com/vghelp/source/html/modvbs.htm

 

or

 

B.

Use VoiceGuides COM functions: Run_ResultReturn(), Script_Gosub(), Script_Goto(), Script_Return(). This needs Enterprise license.

Share this post


Link to post

Hi Indeed I have to use A)

 

Would you be so kind to provide me with a script example that does that:

 

1. I get results from my dll that I call from a VB script

2. The result is stored in a file (as you advised)

3. this result is then read from the file to be said using a play sound module (Do I have to use a Data Query module for that ?)

 

My probleme is that If I user a VBscipt module to reaf the file again I will be able to retrieve the value to be says using a play sound module

 

 

thank you for your help.

Mh

 

Share this post


Link to post

The Help file has an example of how to use VBScript to save data in a Result File. See http://www.voiceguide.com/vghelp/source/html/modvbs.htm and look at the "Creating Result File" example. you need to specify the saved file's path to be in the same directory as the VoiceGuide script that is being ran.

 

The Result File is automatically read in by the Run VBScript module after the VBScript completes running and the Result Variables read in from the result file are then available to the VoiceGuide script running on that line.

Share this post


Link to post

Works fine but I have a question regarding the way VG is handling these result files.

Alghough results are stored on text file, it seems that Result files can be used only in a Script that has generated them. is this correct?

If I call other script it will not read that file again ..?

 

Share this post


Link to post

The file is not deleted by VocieGuide, so if you use the Result Files then you should ensure they are either overwritten or deleted by the next Run Program or Run VBScript, or that they are deleted before the next Run Program or Run VBScript module is executed.

 

It is more common top use a COM function to return result from a Run VBScript module, but I guess that you are using Result Files instead as you are running a Professional version of VocieGuide, not an Enterprise version, correct?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×