Add step C/C++ DLL to "PlaySound" (winmm.dll)

I have been searching the forum to try to find my answer and examples, but have not found a solution yet.

I currently have a DLL that has a call to the Windows "winmm.dll" (Directory Windows\System32) system in a step ActiveX adapter, I can beep. (use c# and VB 6 code in the past)

I use it mainly to play a sound to indicate that my code has reached a 'Fail' step for debugging.

I am reorganizing my test systems to make them (there are 2 independent systems) so that I can check them in to TFS (source control) and allow them to be independent, absolute path using only the relative paths for the entire sequence and DLL calls.

The problem I have is that I use the same process template for both, and I don't want to have an absolute path to the DLL that contains the 'Play Sound' function in the DLL.  The process model is called by TestStand top of the stack.

I tried to access the "winmm.dll" to play the sound and the "mciexecute" function, but I can't step configured in my sous-suite ProcessModelPostStepFailure of process model.

When you configure the Action step (as a "C/C++ DLL adpapter to the dll, I keep hitting roadblock that I get errors.)

How to configure this adapter to match the function calls to the 'mciexecute '.

Code c# uses system.media.SoundPlayer reference:

This is called TestStand
public static void PlaySound (String Path)
{
SoundPlayer spWave = new SoundPlayer (Path);
spWave.Play ();
}

and VB 6 code is:

Private Declare Function mciExecute Lib "winmm.dll" (ByVal FileName As String) As Integer

'# Function to play a sound. Used to report errors, or whatever.
Public Function Sound (ByVal FileName As String) As Integer
' Arg: filename is the full path to one. To play WAV file.
"Play sound
Sound = mciExecute ("Play" & FileName)
End Function

Is this possible in an adapter TestStand steps?

"How mocking the adapter correctly call for the ' mciExecute ' function?

Mike

Humphrey is incorrect. You can call this dll directly from TestStand. Most of the function prototypes can be called directly from TestStand. However, you will need to manually specify the prototype since the dll has no type information for which TestStand can automatically get the prototype. Simply specify the prototype as shown in the screenshot1.jpg file (return value is a 32-bit integer, the parameter is a string C const). You can also call directly to the .NET API from .NET adapter as shown in the screenshot2.jpg file

Tags: NI Software

Similar Questions

  • How to add steps before job Auto resources to the request referred to in the annex to the Auto

    I hope that I can describe my question clearly for you.

    My sequence is something like the following:

    It is a simple sequence.

    Test # 2 is faster that 1 Test so that it usually leads to test 1 is occupied by a testsocket and expected by the other testsocket.

    However, the process of loan (10 seconds) is independent of the resource, and it's too long.

    My question is... can I do the lending market (10 seconds) when the Test 1 is occupied by other testsocket?

    The step of resources at the request of uto use A contains an array of resource Expressions.  The idea behind this is that you have 2 instruments on your BENCH that are the same.  In this way, the test may choose to use one or the other and still accomplish his goal.  So what happens is that if you don't have only one resource, then any thread gets there first takes the resource and locks.  Other threads cannot enter this article until at least one resource is available.  So if you dynamically add resources then you can allow other threads in this article.

    You can consider making a step in the Routine 2 which adds a resource to the Routine 1.  In this way, they won't all get routine 1 front 2 routine.

    I think that to get the desired behavior, you're going to need to do some manipulation of dynamic resource expression.

    Kind regards

  • After installing Lightroom 10 CC 2015, Photoshop CC 2015 windows does not start and Illustrator CC 2015 freezes after startup. It look like that the program (or maybe add ons) need to dll of the CC + 2008 with isn't so more recordable in Windows 10

    Has anyone have the same problem and maybe a Solution?

    Hey mksuperplus,

    Please check this link Windows 10 update breaks Microsoft Adobe CC - missing - MSVCR110.dll community for the solution.

    Kind regards

    Nicos

  • Adapter DLL: Name of the function change & params without unloading of the DLL

    Hello

    I use teststand adapters API to dynamically build a DLL call step. Each dll function is called through this subsequence "DLL Manager."

    Tried 2 methods (here is a summary of the code):

    1 ActiveX as follows:

    CommonCModule.ModulePath = myDllpath

    CommonCModule.FunctionName = myFunc (Note: this call unload the DLL previously loaded)

    Module-> LoadPrototype

    (to set the params)

    2 steps statement:

    RunState.Sequence.Main ["Call DLL function']. TS. SData.Call.LibPath = myDllpath

    RunState.Sequence.Main ["Call DLL function']. TS. SData.Call.Func = myFunc (Note: this is a step, but the info seems not be updated-online the new feature is called not properly)

    Module-> LoadPrototype

    (to set the params)

    The two methods is exactly the same behavior, but good for the 1st function I call a work or if I dump the dll after the execute step.

    However, is there a way to use these steps (or other) at stage configuration, but without unloading the DLL between each call. In my test sequence, I must OpenConnection with the object to be measured before starting my orders, as well as the dll should not be discharged to keep the connection open...

    for example

    (1) OpenConnection()-online this function takes the handle of communication with the device

    (2) myCommand1()

    (3) myCommand2()

    (4) CloseConnection()

    Thank you for the help

    C.

    If I understand your question, there are several ways to solve the problem. The easiest is to place a call to the dll before your loop that you never change programmatically. This step will then keep the loaded dll (if any stage that uses a dll is loaded, then the dll remains loaded. A dll is unloaded when all the steps that use it are unloaded.). Another option is to have just internally your call to the dll LoadLibrary on itself so that it is never unloaded. You then leave the process to unload the dll well. Another option is to add the code directly to the sequence that explicitly, charge and discharge your dll with the Win32 API LoadLibrary and FreeLibrary.

    That said, what you describe, if I understand correctly, looks like a very unusual use of TestStand. Looks like you use TestStand as a dll calling rather than as a sequencer and write your own sequencer above it instead. Have you thought to generate an entire sequence to run in teststand, rather than a step at a time? Basically, convert your test script in a TestStand sequence.

    Hope this helps,

    -Doug

  • DLL to call a subsidiary static library

    I have compiled a DLL using labwindows calling a subsidiary static library. I added a step to test that calls this DLL.  On my development station, everything is good.  The subsidiary library is named.  But, on a deployed workstation, I get a "cannot load the DLL.

    According to the reference manual, I can preload subsidiary attendance using the adapter of the CVI.  I get the same error on my deployed station...

    You get an "Unable to load a DLL" error when a dependency is missing.

    Please check this way:

    Download the tool free dependency walker- http://www.dependencywalker.com/

    Select the DLL (deployed machine).

    It will show you which component of the dependency is missing in the deployed machine.

    For CVI.

    Since you are using a static libarary - include you in the build when you build the project?

    It should be incorporated in your DLL. (help to add files to the DLL option in the CVI target settings).

    I hope this helps.

  • Pedometer steps Complication

    Hi, the reason why I bought a Apple Watch was to keep track of my steps.  (my workplace has a program that encourages us to take a number of steps per day)

    Sorry if this is the wrong place to ask, but does anyone know of an application that displays a complication on my watch face that displays my steps?  I found an application that has a complication for the steps (see health), but it seems to display measurements taken on the phone, no measures taken according to the pedometer of the watch.

    Hello

    If it is not currently possible via built-in apps, you can add steps to the face of the watch (via a "complication") using a third-party application.

    For example, pedometer ++ integrates with the health app and offers watch face complications:

    https://iTunes.Apple.com/us/app/pedometer++/id712286167?Mt=8

    More information:

    Change the face of the watch on your Apple Watch - Apple Support

  • Standalone application, including dll, ocx and Word template folder

    Hello

    I'm trying to create a stand-alone Application with labview 2011. My problem is how can I include ocx and dll files in my executable to run by other computers (the other computer doesn't have the ocx to use in the application and the dll). My program use Word located in a folder template. How can I integrate this file model in my executable file.
    It's the first time I have create an executable file, so please help me-_ -

    NKI

    Hello

    Finally, I would add my ocx and dll in my project (add the file). When I configure the executable file in the Source file, I have always understood the ocx and dll.

    For the proprieties of the installer, in settings of Source code file, I select my ocx and dll and in file and folder attributes I check "register COM.

    I don't know if that the right way to do it but it works.

    NKI

  • How to change the name of the function before the generation of a DLL

    I am building a platform of image analysis software that will import an image offline or online from a camera to a directory of files. I write software architecture as an exe will attract several dll image analysis to analyze the image and return data.

    Analysis of image dll will change and be added at any time. If the DLL file must be called dynamically by the exe.

    I did all the DLLs were strictly of the same type of input-output. If the exe file will read the path of the DLL from a text file and call the DLL as a result.

    The advantage is that I don't have to recompile the exe even add or delete some DLL files.

    Unfortunately, I get error "Call library function node" when it tries to call the second DLL.

    Calling different DLLs dynamically without adding the dll in the vi, is it possible to do in 2012 of LabVIEW?

    Help, please...

    Yes, you can.

    Here is a starting point:

    http://digital.NI.com/public.nsf/allkb/77594203D78D12278625729100758BE5

    Regarding the error you get:

    can you post a snapshot of the code?

    Kind regards

    Marco

  • Insert steps in sequence of runtime using DefaultSequenceValues

    As part of the sequence call step type custom that I see, I want to add steps to the sequence called, but only when running.

    I found the runtime class methods to modify the copy of the length of the sequence: News/Set/Get/Clear SequenceDefaultValues, but I'm getting strange errors when I use them to try to insert a step. Change the properties of the sequence (for example GoToCleanupOnFail) works very well.

    When I use these API methods to try to insert the step in the single sequence LENGTH, I get an error index invalid step '0' for 'Setup' phases 'Tests' sequence.

    Locals.SequenceRef = RunState.SequenceFile.GetSequenceByName("Tests"),
    Locals.DefaultSequence = RunState.Execution.NewSequenceDefaultValues(Locals.SequenceRef),
    Locals.StepClone = RunState.Sequence.GetStepByName("Label",StepGroup_Setup).AsPropertyObject.Clone("", PropOption_CopyAllFlags | PropOption_DoNotShareProperties),Locals.DefaultSequence.AsSequence.InsertStep(Locals.StepClone, 0,StepGroup_Setup),
    RunState.Execution.SetSequenceDefaultValues(Locals.DefaultSequence,SeqDefValueScope_Execution)
    

    I found this similar code works for y to insert the step of the edit-time sequence:

    Locals.SequenceRef = RunState.SequenceFile.GetSequenceByName("Tests"),
    Locals.StepClone = RunState.Sequence.GetStepByName("Label",StepGroup_Setup).AsPropertyObject.Clone("", PropOption_CopyAllFlags | PropOption_DoNotShareProperties),Locals.SequenceRef.AsSequence.InsertStep(Locals.StepClone,0,StepGroup_Setup)
    

    I found in my research that the SequenceDefaultValues methods have been designed for the shipper of the property. It's using more current would be updating the inhabitants of the sequence. Change the steps in the sequence not supported?

    The error, I guess there is an incompatibility somewhere between the table of the Sequence.Setup [] array (which is updated) sequence steps and another value that stores the number of steps in the installation step group (which is not updated). In addition, the error refers to the configuration 'phase' not 'step group', which implies to me that it's an internal engine error, NOR is generally cautious with their nomenclature for the outside facing error messages.

    I also found this old KnowledgeBase of TestStand 2.0 which says that TestStand handles an internal pedometer for the current step group. Is there something similar happening here?

    Attached is a sequence of TestStand 4.2.1 file that shows the error in more simple one case I can do (unfortunately 4.2.1 is the version is using my client, and they have not been convinced to further improve).

    Hi Josh,.

    I appreciate the detailed post!  After some research, the problem here is that when a subsequence stage called a sequence, it uses the copy of the file edit-time to verify the number of steps, but tent then run the copy of the execution, which is different.  Because there is a mismatch, the error occurs.  I have found a solution that may work for you, but first I want to point out that TestStand supports not structural changes of any file of sequence that is currently responsible for execution. The term "structural change" includes things like:

    • Add or remove steps
    • Add or remove sequences
    • Add or remove properties
    • Changing the settings of the module or adapter step

    This is why the sequence editor prevents you from changing a file of sequence while it running. Operations such as changing the property values are not considered to be 'structural change', that is why the shipper of the property can change the limits of dynamic sequences successfully.

    The solution is to create a new sequence file to contain a clone of the sequence you change and then load this file of sequence dynamically step of calling sequence.  Using this method, the new sequence file is not loaded for execution until when structural changes are complete.  In addition, because the execution copy is not created until the sequence do not call, using the methods SequenceDefaultValues is more necessary.  I have attached a modified version of your example that illustrates this approach.

    If this approach does not work in your case, let me know and we can look into other possible methods to go about it.

  • Error loading c:windows\system32\sshnas.dll wants to say what and how do I clear this pop up?

    Error loading c:windows\system32\sshnas.dll wants to say what and how do I clear this pop up?

    Hello

    Step 1: sshnas.dll is a component of spyware or malware.  Online virus and malware scanner and check.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Step 2: You can also see the question in the clean boot state.

  • Install the oraoledb11.dll registration number

    I have a machine that has Visual Studio installed 2015 and try to install ODTWithODAC112021.  I realize that probably some tools may not work, but the installation hangs at step save OraOLEDB11.dll with windows.  I tried 3 different times without success and then he lets just around files without finishing.  This is not really related to my Visual Studio but wanted to mention it anyway.

    It is the version currently in our application, and we are not looking to upgrade to a newer version that would require a little regression tests.

    This DLL is part of OLE DB for Oracle. If you do not plan to use OLE DB, you can just uncheck this option on the Setup screen that asks where you want to install the components.

    If you do not need this component, the Setup will usually display error information in a log. This output is required to help identify the problem.

    However, I would recommend using the latest version of the ODAC (12 c, R3), rather than the release of the ODAC you are trying to install. This one, 11.2.0.2.1, is 4.5 years. It does not support Visual Studio 2015 nor Windows 8.

  • CS3 Acrobat 8.0 installs not because of incorrect serial number

    Try to reinstall Acrobat 8.0 on a x 64 Office Win8.  All other CS3 products work.  The acrobat folder seemed to miss the .exe and .dll file.  I insert the disc for installation of CS3 applications, navigate to the Acrobat .msi installer and start the process.  He asks the serial number.  I entered it with hyphens and without, but still get an invalid serial number message and the installation cannot continue.  I checked the serial number on the Adobe LWS and also called the Adobe technical support, and they checked the serial number is correct.

    However the tech guy has also stated that he could not help me since CS3 is no longer supported.  He said to uninstall, but there is no option to uninstall since Windows does not see installation.  I tried to close all the Adobe programs and service in the Manager of tasks, but again got the same message invalid series No.  I am reluctant to uninstall the entire suite because I rely on Dreamweaver to manage my organization's Web site.

    I have continued on a laptop, but it was old and get very slow, so I moved it to a new workstation.  I tried to copy the Acrobat 8.0 folder full of the laptop. Even if all the files seem to be now on the workstation, the machine is not passed through the installation process, so the executable will not work.

    Seem to be stuck in a catch-22 of Adobe.

    The S/N of CS will not work with the stand-alone Acrobat. You must go through the process of installing CS. Even if you are it installed, don't expect AA 8 work with Win 8.1. I did not talk about someone still succeed. If Acrobat Distiller install and open, the problem will probably be with the printer driver and AcroTray. Assuming that any installed, do the updates before going any further. If you are all updated, then specify what problems you are experiencing. There are workarounds for the printing process, but they add steps in the process.

  • How to create ProcessModel calculate TOTAL as follows to call the file in the sequence?

    I made a custom operator Interface and I want to support a progress bar for giving the user indicates to what extent this time they represent.   I already have the infrastructure of reminder Setup so that the progress bar will be updated based on a Message from the user of the motor.

    In the process template itself, I put in place a "ProcessModelPostStep" (the purple one) reminder so that after all the steps of the calling sequence file I increment an internal counter and send these data as well as the Message of the user.

    The only missing part is to know how to calculate the TOTAL number of steps in the sequence file calling.  I can get the total number of SEQUENCES defined in the calling file but I how to recursively on each sequence loop excluded from top down by counting all the steps of the sequence of the callee.

    Appreciate any help in getting this last piece in place.

    Thank you!

    I have a better solution in the images below.  The code snippet is the code called by TestStand to introduce recursion.

    The attached code is the recursive call.  It is similar to my first post, but the fixed a bug with the cast of references.

    This should get the total number of step.  The code works under some assumptions:

    1. all called sequences are in the same file in sequence.  (You can add steps to also get the path to the movie file and retrieves the sequence from there.)

    2. There is no asynchronous LabVIEW step in TestStand.  (These are treated as sequence calls into the API, and you must add code to sort.)

    Pulido Technologies LLC

  • HP15: error Hp printer after you remove the program from the printer.

    I looked in the startup of Windows C. and ran msconfig, but can not find the files that has been said in the previous post.

    So what I do now? I want to get rid of this error message at the beginning upward

    Hey @vmundy2,

    Thanks for getting back to me on this subject.

    The HPStatusBl.dll is alerts ink Monitor on the computer. The uninstall process could not delete the shortcut for it.

    I can have you try the steps mentioned by my colleague @HevnLgh here: Re: DLL problem run to remove the specific file.

    Please let me know if these steps resolve the dll error. Good luck!

  • C# create file of sequence with markets

    I am using the c# API in order to create a sequence file that can be loaded in TestStand. When I try to create a step, I gives me the error:

    Additional information: step enter 'Action' not found in the type list

    I am using the following:

    class Teststand
    {
    Engine engine;
    File SequenceFile;

    public Teststand()
    {
    engine = new Engine();
    }

    Public Sub new_sequence()
    {
    engine = file. NewSequenceFile();

    Sequence seq = engine. NewSequence();
    Name = "Example".

    Step motor =. NewStep ('no adapter', 'Action');
    step. Name = "step Test".

    save_sequence_file (@ "C:\Users\me\Desktop\output.seq");
    }

    public void save_sequence_file (string file_path)
    {
    file. Save (\\server\share\file_path);
    }
    }
    }

    I know that I'm not add step to the sequence file immediately, but certainly would not be the cause of the problem? Why can't he find the step type? I tried several types and even tried

    StepTypes.StepType_Action

    Gives me just the same idea.

    I'm very confused about how to specify the type of property, can anyone help?

    Hi adam_.

    It is recommended to add the new step in the TypeUsageList of the sequence file is inserted it into:

    class Teststand
    {
    Engine engine;
    File SequenceFile;

    public Teststand()
    {
    engine = new Engine();
    engine. LoadTypePaletteFilesEx (TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
    }

    Public Sub new_sequence()
    {
    engine = file. NewSequenceFile();

    Sequence seq = engine. NewSequence();
    Name = "Example".
    file. InsertSequenceEx (file.) NumSequences, seq);

    Step motor =. NewStep ("no adapter", "Action");
    step. Name = "step Test".
    file. AsPropertyObjectFile(). TypeUsageList.AddUsedTypes (step. AsPropertyObject());
    seq. InsertStep (step 0, StepGroups.StepGroup_Main);

    save_sequence_file (Environment.GetFolderPath (Environment.SpecialFolder.Desktop) + @ "\output.seq");
    }

    public void save_sequence_file (string file_path)
    {
    file. Save (\\server\share\file_path);
    }
    }
    }

    Here are the things I added to your code:

    1. Engine.LoadTypePaletteFilesEx

    2. SequenceFile.InsertSequenceEx

    3. TypeUsageList.AddUsedTypes

    4. Sequence.InsertStep

    5. Environment.GetFolderPath (Environment.SpecialFolder)

    Kind regards

    The f

Maybe you are looking for