05-31-2013 12:28 PM
Hi all.
I would like any and all help. I am developing on LabWINDOWS 2010 and am trying to use the Windows API, particularly the multimedia APIs, in my CVI code. What I am trying to do is audio development, only it has to be in .NET or Visual C++ platform. I have developed the code and UIR, but when I build the solution it tanks on me. Of course when I use MS Visual C++ 2008 or 2010 there are no errors and I could use MS Visual C++ to develop my application, but the development of the user interface and the controls is much more straight forward with CVI and there are more controls to work with than there are with MS Visual C++. Most of the errors that I get are related to the following header files: "MMSystem.h", "devicetopology.h", and the "endpointvolume.h". When I try and build a skelton project with no controls or indicators on the .UIR I get the errors like:
"devicetopology.h"(2301,20) Missing parameter type.
"devicetopology.h"(2301,40) syntax error; found '*' expecting ')'.
"MMSystem.h"(151,1) Unrecognized declaration.
"MMSystem.h"(850,96) syntax error; found 'identifier' expecting ')'.
That is just a few of them, but they typically say the same thing. I have included the header files and libraries in my project, and have made sure that they are in the CVI "sdk" directory. I have tried example code that have these header files and the result is still the same. I know that I should not have these type of issue, at least I don't think I should. Like I said I could use as much help as possible of figuring out what is the matter. Did I install the CVI improperly? Are there patches that I need to actually use windows APIs? I am attaching to this post my code and the code I downloaded from a LabWINDOWS forum. When I ran the code from the forum I got the same errors.
Thanks in advance.
06-03-2013 02:08 PM
Hi vehnasa1,
AudioVolume should compile okay. For using devicetopology.h, try defining NTDDI_VERSION before your include statements.
06-04-2013 06:20 AM
Humphreyy,
thanks for the tip. I tried it but it did not work, the same errors were present. Are there any other suggestions. I have racked my brain to figure out why this is happening and have come up with nothing. I am also getting a "Warning" message concerning the "KsMedia.h" file that says "Warning: Excess characters in multibyte character literal ignored." The warnings trace back to the "typedef enum" section of that file. Could that be causing a ripple effect that produces the error I am seeing in the other header files I mentioned??
I could really use your help and any more help that is available. I really don't want to use Visual C++, because this software is going to get more sophisticated and is to be used in NASA Langley's VISTAS simulator, an environment taylor made for National Instruments software.
06-05-2013 11:39 AM
How did you define NTDDI_VERSION?
I can't actually compile your entire code but the headers compiled okay (I removed the ones that I do not have)
06-05-2013 12:28 PM
I just defined it the usual way user defines are done: #define . Which header files did you have to remove??
06-06-2013 10:05 AM
These compile fine for me:
#define NTDDI_VERSION NTDDI_WIN7
#include <windows.h>
#include <devicetopology.h>
#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
#include <stdio.h>
and
#include <windows.h> #include <mmsystem.h> #include <cvirte.h> #include <userint.h>
06-11-2013 03:17 PM
Humphry,
I tried the last suggestion and got the same problem. Anymore thoughts. Is it possible that I have installed CVI incorrectly or something. This is truly bizarre. If you have anything else I am willing to give it a go. I am at a lose.
06-12-2013 10:07 AM
So it's giving the same errors?
Do examples that use windows.h compile okay?
06-12-2013 10:36 AM
Humphrey,
yes there are examples that have windows.h that run. I even have code that I have developed that has the windows.h header in it and they build with no errors at all, but the earlier mentioned header additions are causing error explosions. That is why this is really puzzling me.
06-13-2013 11:28 AM
If trying to compile just the headers that I listed is giving you errors, I wonder if some of those files are missing on your computer. You might want to double check on that.