A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

api



 
 
Thread Tools Display Modes
  #1  
Old April 20th, 2010, 04:04 PM posted to microsoft.public.access
Anders[_5_]
external usenet poster
 
Posts: 2
Default api

Hey group
I havefor years been using the mci-thing as this:
Declare Function apimciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Declare Function apimciGetErrorString Lib "winmm.dll" _
Alias "mciGetErrorStringA" (ByVal dwError As Long, _
ByVal lpstrBuffer As String, ByVal uLength As Long) As Long

Function mp3Play(filename As String)
On Error Resume Next
Dim temp As String * 255
If Dir(filename) = vbNullString Then Exit Function
filename = GetShortPathName(filename, temp, 254)
filename = Left$(temp, filename)
apimciSendString "Close Mp3", 0, 0, 0
apimciSendString "Open " & filename & " Alias Mp3", 0, 0, 0
apimciSendString "Play Mp3", 0, 0, 0
End Function

in my access-applications, to play a mp3 file as the result of an event in
some forms. It works fine in alle the versions of office/access, but when it
comes to work in Windows Vista there is no sound. It is strange that there
is no error and i made a "progress-bar" on my own, and the bar is growing as
the time is passing, as it does on the WindowsXP machine, where the sound is
coming out of the loudspeaker.

Could anybody come up with a solution. I dont want to use a ocx-control.

Best regards
Anders

  #2  
Old April 20th, 2010, 06:51 PM posted to microsoft.public.access
James A. Fortune
external usenet poster
 
Posts: 903
Default api

On Apr 20, 11:04*am, "Anders" wrote:
Hey group
I havefor years been using the mci-thing as this:
Declare Function apimciSendString Lib "winmm.dll" Alias "mciSendStringA" _
* * (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
* * ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Declare Function apimciGetErrorString Lib "winmm.dll" _
* * Alias "mciGetErrorStringA" (ByVal dwError As Long, _
* * ByVal lpstrBuffer As String, ByVal uLength As Long) As Long

Function mp3Play(filename As String)
On Error Resume Next
Dim temp As String * 255
* If Dir(filename) = vbNullString Then Exit Function
* filename = GetShortPathName(filename, temp, 254)
* filename = Left$(temp, filename)
* apimciSendString "Close Mp3", 0, 0, 0
* apimciSendString "Open " & filename & " Alias Mp3", 0, 0, 0
* apimciSendString "Play Mp3", 0, 0, 0
End Function

in my access-applications, to play a mp3 file as the result of an event in
some forms. It works fine in alle the versions of office/access, but when it
comes to work in Windows Vista there is no sound. It is strange that there
is no error and i made a "progress-bar" on my own, and the bar is growing as
the time is passing, as it does on the WindowsXP machine, where the sound is
coming out of the loudspeaker.

Could anybody come up with a solution. I dont want to use a ocx-control.

Best regards
Anders


Anders,

That is one of the exact reasons why I am working on replacing all my
API function calls in all versions of Access with equivalent .NET
function calls. Where I work, everyone routinely updates their system
to include all of the .NET Framework versions. Although running an
API function is easier, I think that the .NET equivalent functions
will prove to be more robust. Furthermore, adding .NET functionality
to Access opens a vast panorama for extending Access' capabilities.
Since more people are going to want those capabilities, perhaps I can
move up the priority of implementing that. I have been reading C#
books like crazy and have also been going through all the PDC08
sessions so I haven't been able to focus on API function
substitution. In the meantime, perhaps someone can find a workaround
for your problem.

James A. Fortune


I soon realized that learning C# would be like learning about Ancient
Egypt. I.e., no one book is going to provide all the information I
need or want. I even think of the C# Language Specification as the
"Book of Hints."
  #3  
Old April 21st, 2010, 05:55 AM posted to microsoft.public.access
Anders[_5_]
external usenet poster
 
Posts: 2
Default api


That is one of the exact reasons why I am working on replacing all my
API function calls in all versions of Access with equivalent .NET
function calls. Where I work, everyone routinely updates their system
to include all of the .NET Framework versions. Although running an
API function is easier, I think that the .NET equivalent functions
will prove to be more robust. Furthermore, adding .NET functionality
to Access opens a vast panorama for extending Access' capabilities.
Since more people are going to want those capabilities, perhaps I can
move up the priority of implementing that. I have been reading C#
books like crazy and have also been going through all the PDC08
sessions so I haven't been able to focus on API function
substitution. In the meantime, perhaps someone can find a workaround
for your problem.

James A. Fortune


I soon realized that learning C# would be like learning about Ancient
Egypt. I.e., no one book is going to provide all the information I
need or want. I even think of the C# Language Specification as the
"Book of Hints."

Hey James.
Thanks for your interest.
I think it would be exellent to implement .net in access. That would open a
lot of possibilities.
Until that happens i am still sorry that my sounds does not come when I
expect it to come.
I therefor hope that somebody will come up with a solution.
Regards
Anders

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.