Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

How to Play a Sound File with Dexterity

How to Play a Sound File with Dexterity

Rate This
  • Comments 6

Dave DusekThis is really an extension of the blog article that David Musgrave wrote VBA - Welcome to Dynamics Example, but instead of using VBA to play the sound file, we are using Dexterity. The same method is called in the winmm.dll, but this is just the Dexterity way to do it. I didn't include trigger information on this because you could really put this anywhere.

I am playing the Welcome.wav, but you could play any wav file with this.  This came up in a recent support incident, so that's why I'm posting this info.    

First, you need to create a Dexterity prototype procedure.  Here is what that would look like.  The name is important and must be PlaySound@winmm.dll.

PlaySound@winmm.dll Global Procedure

Now, you just need to call the method via the extern command.  Here is what your calling script would look like:

Example Calling Script

Dave Dusek
Dynamics GP Developer Support

// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

  • Dave,

    Simple and sweet!

    MG.-

    Mariano Gomez, MVP

    Maximum Global Business, LLC

    http://www.maximumglobalbusiness.com

  • do we have to register the DLL if it is a new kind of DLL?

  • Hi Nilotpal

    When using the extern statement to call a win32 dll, there is no need to register/unregister it.

    Thanks to Pat for this info.

    David

  • Thanks,

    but i wrote the DLL in Visual basic 2005, and not able to call it. Please refer to my post "calling dll from dexterity".

    regards,

    nilotpal

  • hi,

    i created the DLL form Visual Basic Class library, so is it win32 dll? if not, then how to use it in dexterity?

  • You cannot create a Win32 assembly using vb 2005 so that is why it doesn't work.  That is only possible from C/C++.  

    From .net, you would have to create your assembly so that it is COM interop enabled.  Then you'd use normal COM method calls from Dexterity to call those methods.

    That should get you going.  If you have any further questions please open a support incident or post to the newsgroups.

    patrick

    dev support

Page 1 of 1 (6 items)
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 7 and 1 and type the answer here:
  • Post