Connecting Tech Pros Worldwide Help | Site Map

How to use a DLL in MS-Access VBA

 
LinkBack Thread Tools Search this Thread
  #1  
Old February 27th, 2007, 09:45 PM
nmanausa@gmail.com
Guest
 
Posts: n/a
Default How to use a DLL in MS-Access VBA

I am programming an Access database for a blind co-worker. I need to
plug in a DLL, but I've never done it before.

Here's all the information that is available (after hours of
Googling):

http://blindprogramming.com/pipermai...ry/005286.html

The purpose of this DLL is to pass a string to the DLL which in turns
speaks the string through a JAWS reader to the user.

I've tried for hours, but pardon the pun, "I'm flying blind".

There are two DLL's that are referenced: JFWAPI.DLL and JFWAPICtrl.dll
the routine in the library I am trying to use is JFWSayString.

JFWAPI.DLL will not load through the Tools>References, but
JFWAPICtrl.dll will load.

Any help would be greatly appreciated.

Thanks,

Neil


  #2  
Old February 27th, 2007, 09:55 PM
storrboy
Guest
 
Posts: n/a
Default Re: How to use a DLL in MS-Access VBA

On Feb 27, 5:33 pm, nmana...@gmail.com wrote:
Quote:
I am programming an Access database for a blind co-worker. I need to
plug in a DLL, but I've never done it before.
>
Here's all the information that is available (after hours of
Googling):
>
http://blindprogramming.com/pipermai...programming.co...
>
The purpose of this DLL is to pass a string to the DLL which in turns
speaks the string through a JAWS reader to the user.
>
I've tried for hours, but pardon the pun, "I'm flying blind".
>
There are two DLL's that are referenced: JFWAPI.DLL and JFWAPICtrl.dll
the routine in the library I am trying to use is JFWSayString.
>
JFWAPI.DLL will not load through the Tools>References, but
JFWAPICtrl.dll will load.
>
Any help would be greatly appreciated.
>
Thanks,
>
Neil

For starters they must be registered on the computer. This is usually
done when a program is installed but there is a Windows utility you
can use to do it manually. Go to Start Run and in the dialog box
type in ...

regsvr32.exe "InsertPathToFile\JFWAPI.DLL"

A message should appear telling you if the file was registered
sucessfully.

Secondly, the resource must expose parts of itself in order for you to
use them. Just because it's registered on the computer or referenced
in the database dosen't mean its usable. I would guess you have
documentation telling you what you can access in each file?

  #3  
Old February 28th, 2007, 12:25 AM
Stephen Lebans
Guest
 
Posts: n/a
Default Re: How to use a DLL in MS-Access VBA

The library JFWAPI.DLL is a standard Windows library and not a COM object.
You do not and cannot set a reference to it from within Access.

I spent a few minutes tonight trying to get the control or the standard API
interface to work from an Access form. I cannot test this properly as I do
not have JAWS installed and running on this system.

Here's the code I used for the API library interface. I left in the code for
calling the SayString method of the Jaws Com control interface I inserted
onto a form.



Private Declare Function apiJFWSayString Lib "C:\SourceCode\JAWS\JFWAPI.DLL"
_
Alias "JFWSayString" (ByVal lpszStrinToSpeak As String, bInterrupt As
Boolean) As Boolean


Private Sub cmdPlaySound_Click()
On Error GoTo Err_cmdPlaySound_Click

Dim s As String
s = "Hello, wow, you are a Good Looking Guy!"
s = s & s & s & s
Set JW = Me.ActiveXCtl0.Object ' JFWApi
' JW.Enable 0
Dim blRet As Boolean

blRet = apiJFWSayString(s, True)
'JW.SayString s, False


'Me.ActiveXCtl0.Object.SayString s, True

Exit_cmdPlaySound_Click:
Exit Sub

Err_cmdPlaySound_Click:
MsgBox Err.Description
Resume Exit_cmdPlaySound_Click

End Sub

Private Sub Form_Load()
'Dim JW As JFWApi


End Sub
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


<nmanausa@gmail.comwrote in message
news:1172615606.241107.262970@z35g2000cwz.googlegr oups.com...
Quote:
>I am programming an Access database for a blind co-worker. I need to
plug in a DLL, but I've never done it before.
>
Here's all the information that is available (after hours of
Googling):
>
http://blindprogramming.com/pipermai...ry/005286.html
>
The purpose of this DLL is to pass a string to the DLL which in turns
speaks the string through a JAWS reader to the user.
>
I've tried for hours, but pardon the pun, "I'm flying blind".
>
There are two DLL's that are referenced: JFWAPI.DLL and JFWAPICtrl.dll
the routine in the library I am trying to use is JFWSayString.
>
JFWAPI.DLL will not load through the Tools>References, but
JFWAPICtrl.dll will load.
>
Any help would be greatly appreciated.
>
Thanks,
>
Neil
>

  #4  
Old February 28th, 2007, 06:45 PM
Typehigh
Guest
 
Posts: n/a
Default Re: How to use a DLL in MS-Access VBA

On Feb 27, 8:19 pm, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
Quote:
The library JFWAPI.DLL is a standard Windows library and not a COM object.
You do not and cannot set a reference to it from within Access.
>
I spent a few minutes tonight trying to get the control or the standard API
interface to work from an Access form. I cannot test this properly as I do
not have JAWS installed and running on this system.
>
Here's the code I used for the API library interface. I left in the code for
calling the SayString method of the Jaws Com control interface I inserted
onto a form.
>
Private Declare Function apiJFWSayString Lib "C:\SourceCode\JAWS\JFWAPI.DLL"
_
Alias "JFWSayString" (ByVal lpszStrinToSpeak As String, bInterrupt As
Boolean) As Boolean
>
Private Sub cmdPlaySound_Click()
On Error GoTo Err_cmdPlaySound_Click
>
Dim s As String
s = "Hello, wow, you are a Good Looking Guy!"
s = s & s & s & s
Set JW = Me.ActiveXCtl0.Object ' JFWApi
' JW.Enable 0
Dim blRet As Boolean
>
blRet = apiJFWSayString(s, True)
'JW.SayString s, False
>
'Me.ActiveXCtl0.Object.SayString s, True
>
Exit_cmdPlaySound_Click:
Exit Sub
>
Err_cmdPlaySound_Click:
MsgBox Err.Description
Resume Exit_cmdPlaySound_Click
>
End Sub
>
Private Sub Form_Load()
'Dim JW As JFWApi
>
End Sub
--
>
HTH
Stephen Lebanshttp://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
>
<nmana...@gmail.comwrote in message
>
news:1172615606.241107.262970@z35g2000cwz.googlegr oups.com...
>
>
>
Quote:
I am programming an Access database for a blind co-worker. I need to
plug in a DLL, but I've never done it before.
>
Quote:
Here's all the information that is available (after hours of
Googling):
>>
Quote:
The purpose of this DLL is to pass a string to the DLL which in turns
speaks the string through a JAWS reader to the user.
>
Quote:
I've tried for hours, but pardon the pun, "I'm flying blind".
>
Quote:
There are two DLL's that are referenced: JFWAPI.DLL and JFWAPICtrl.dll
the routine in the library I am trying to use is JFWSayString.
>
Quote:
JFWAPI.DLL will not load through the Tools>References, but
JFWAPICtrl.dll will load.
>
Quote:
Any help would be greatly appreciated.
>
Quote:
Thanks,
>
Quote:
Neil- Hide quoted text -
>
- Show quoted text -
_____________________________

Stephen,

You are my hero!

It worked like a charm.

Neil


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.