From: Anders on
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

From: James A. Fortune on
On Apr 20, 11:04 am, "Anders" <fjernikk...(a)nyraad.net> 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
MPAPoster(a)FortuneJames.com

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."
From: Anders on

<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
<MPAPoster(a)FortuneJames.com
<
<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

 | 
Pages: 1
Prev: Report based on form value
Next: Big Dabate