LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Sound Output VIs

Hi Slowpoke,

I was able to load the DLL successfully using this syntax:
#include <userint.h>
#include "Noise Tool.h"
#include "windows.h"

typedef void (*MYPROC)(LPTSTR);

int main ()  {
    MYPROC ProcAdd;
     HINSTANCE hinstLib;
     int fFreeResult, fRunTimeLinkSuccess;
    hinstLib = LoadLibrary("Noise Tool.dll");
    ProcAdd = (MYPROC) GetProcAddress(hinstLib, "Test123");
    if (fRunTimeLinkSuccess = (ProcAdd != NULL))
            (ProcAdd) ("message via DLL function\n");
    FreeLibrary(hinstLib);
return 0;
}

Can you successfully load the library using this code?

Also, it appears lvsound2.llb is not being linked properly when you build the DLL. What happens if you include C:\Program Files\National Instruments\LabVIEW 8.2\vi.lib\sound2\lvsound2.llb as a support file?

Cheers.

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 11 of 26
(1,737 Views)
ProcAdd = (MYPROC) GetProcAddress(hinstLib, "Test123");

SHOULD SAY

ProcAdd = (MYPROC) GetProcAddress(hinstLib, "PlaySound");

Now who's the Slowpoke? Smiley Wink

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 12 of 26
(1,732 Views)

Hi Michael,

I was unable to successfully load the DLL using the code you posted.  (Perhaps I'm misplacing it within my application...) 

When I include "lvsound.llb" as a support file, I get the following error message:  "The build was unsuccessful.  Possible reasons: Polymorphic VIs cannot be used as Startup/Exported or Dynamic VIs for applications or shared libraries."  Then it gives a file path ending in "lvsound.llb\__ArrWfmsToData.vi".

Additionally, I tried to make an executable out of a VI that successfully called my DLL in LabVIEW, but got the same errors as in my LabWindows program when I tried to run it.  That would seem to confirm that the fault lies with the Application Builder.  What do you think?

Thank you for your time and your patience!

Slowpoke

Slowpoke
CLAD (believe it or not!), using LabVIEW 8.5

They don't call me "Slowpoke" for nothin'!
0 Kudos
Message 13 of 26
(1,728 Views)

Ah.  That might explain things...  Smiley Happy  I'll try again.

Slowpoke

Slowpoke
CLAD (believe it or not!), using LabVIEW 8.5

They don't call me "Slowpoke" for nothin'!
0 Kudos
Message 14 of 26
(1,727 Views)

Hi Michael,

I tried your sample code again and got a linking error: "Failed to open external module."  The VI error described previously remains unfixed.

Thanks,

Slowpoke

 

Slowpoke
CLAD (believe it or not!), using LabVIEW 8.5

They don't call me "Slowpoke" for nothin'!
0 Kudos
Message 15 of 26
(1,716 Views)
Hi Slowpoke,

Let's move back to LabVIEW for a bit, as my inability to reproduce your problem has made me more cautious. Here are some questions to help troubleshoot the LabVIEW DLL build:

1. Have you modified the paths in the sound VIs? Have you moved the sound VI from their default location in vi.lib?
2. Is lvsound2.dll included in your library build?
3. At what point does calling the DLL fail when you build a debuggable DLL (Advanced >> Enable debugging)?

Cheers.

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 16 of 26
(1,708 Views)

Hi Michael,

1.  No.  The sound VIs are in vi.lib.

2.  Yes.

3.  I'm not sure I'm even able to create a debuggable DLL.  I checked the "enable debugging" option in the app builder (as well as the "wait for debugger on launch" option), but the call fails just as it did before, except the error message has changed to "The VI is not executable.  The full development version of LabVIEW is required to fix the errors."

This whole situation is, as Tolkien might say, passing strange.  Might an unistall and reinstall of LabVIEW solve the problem?

Thanks,

Slowpoke

Slowpoke
CLAD (believe it or not!), using LabVIEW 8.5

They don't call me "Slowpoke" for nothin'!
0 Kudos
Message 17 of 26
(1,697 Views)

Hi Michael,

Please disregard the comments under (3.).  I find it helps if I take time to learn how to do things, such as debug a running executable, before posting.  Smiley Tongue 

The DLL fails when I step into the Call Library Function node on the LabVIEW calling VI.  Everything else is as described.

Sorry 'bout that...

Slowpoke

 

 

Slowpoke
CLAD (believe it or not!), using LabVIEW 8.5

They don't call me "Slowpoke" for nothin'!
0 Kudos
Message 18 of 26
(1,691 Views)
Hi Slowpoke,

With this information we can confirm linking to lvsound2.dll as the definitive problem. We now must determine why lvsound2.dll is being linked to incorrectly.

When you probe the file path (or reference) going into the Call Library Function node, what is the exact path?

Cheers.


| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 19 of 26
(1,682 Views)

Hi Michael,

Hope you had a good weekend!  I use the file path selector under "Configure..." (the DLL fails if I select the "Specify path on diagram" option).  The exact file path is:

C:\Documents and Settings\Administrator\My Documents\Projects\LabView Projects\builds\Noise Tool\Noise Tool DLL\Noise Tool.dll

Thanks,

Slowpoke

Slowpoke
CLAD (believe it or not!), using LabVIEW 8.5

They don't call me "Slowpoke" for nothin'!
0 Kudos
Message 20 of 26
(1,669 Views)