LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ObjIdl.h errors

Solved!
Go to solution

Hi John,

 

Have you tried using the undef.h file that Luis posted in Daniel's link?

 

Cheers,

KyleP
Applications Engineer
National Instruments
0 Kudos
Message 11 of 24
(4,369 Views)

Thanks for the response.

 

I did try putting in the undef.h file and I still got the redefinition errors.

I put the undef.h file right before the dsound.h

0 Kudos
Message 12 of 24
(4,361 Views)

Sorry about that, I hit Post instead of Cancel.

I put the Undef.h right before the sal.h in the dsound.h file and I still got all the redefine errors. That's why I just deleted all the redfines in the SAL.h file and that got rid of those errors but now the new errors pop up.

Is there something else I need to do or something I did wrong?

What if there is another file that uses sal.h? Whould I have to find all include files in the Microsoft DirectX and Visual Studios folders that have sal.h and put undef.h before it? 

 

Thanks

JW

 

0 Kudos
Message 13 of 24
(4,358 Views)

Hello JW,

To really solve the redefine errors you will need to search for the conflicing definitions and handle them individually. The Ctrl-Shift-F Find in Files tool in LabWindows/CVI lets you search through selected files for type conflicts.

Even if we undefine all the conflicting definitions, we may run into many other errors.

Looking at your orignial post, it seems that this all stemmed from the Microsoft 2010 SDK having a new sal.h dependancy. Perhaps it would be better to revert to the 2007 SDK and solve the orignial __RPC__in_xcount_full error in the ObjIdl.h file.

From some searches online I came across the following post in MSDN:

"Did you install the DirectX SDK?  If the DirectX SDK was installed after the Windows SDK, the DirectX \include directory will come before the Windows SDK \include directory in your PATH.  This means that Visual Studio will be build with the version of objidl.h that ships in the DirectX SDK.  You must build with the version of objidl.h that ships in the Windows 7 SDK."

 

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Message 14 of 24
(4,344 Views)

Thanks for the reply.

 

I did what you suggested and reverted back to directX 2007 SDK.

Now I am back to the original errors.

Every one of my "C" files flags many errors in Objldl.h.

 

Example:

In Objldl.h

Missing Parameter type - Highlights - __RPC__out_xcount_part

Expecting an identifier - Highlights *

Syntax error , expecting ")" - Highlights *

 

HRESULT ( STDMETHODCALLTYPE *Finish_Pull )(
            __RPC__in AsyncIPipeByte * This,
            /* [length_is][size_is][out] */ __RPC__out_xcount_part(cRequest, *pcReturned) BYTE *buf,
            /* [out] */ __RPC__out ULONG *pcReturned);

 

Where do I go from here?

 

Thanks

JW

 

 

 

 

0 Kudos
Message 15 of 24
(4,336 Views)
Solution
Accepted by jwinterb

We tried a few things on our end and were able to get it to work with the following sequence of definitions using the 2010 Microsoft DirectX SDK.

 

In your app do the following:
#include "windows.h"
#include "mmsystem.h"
#include "dsound.h"
 
 
and then in dsound.h, modify it so that it is:
#include <objbase.h>
#include <float.h>
#include "undef.h"
#include <sal.h>


The undef.h from LuisG in the linked post, needs to be placed before sal.h
 
Let's hope that works.

 

Jacob R. | Applications Engineer | National Instruments

Message 16 of 24
(4,308 Views)

OK!

That was a huge improvement, got rid of most of the errors.

 

Now only one file is causing a problem.

 

I have a file called InterfaceBrd.c that uses the include file NIDAQmx.h

 

In the folowing statement:

 

int taskHandle;

status = DAQmxCreateTask( taskName, &taskHandle );

 

I am getting this error:

DAQmxCreateTask - found pointer to int, expected pointer to TaskHandle

 

I got no error when I built this in Labwindows 8.1.

 

What do I need to fix this?

 

Almost there hopefully!

 

Thanks!

John W.

 

 

0 Kudos
Message 17 of 24
(4,300 Views)

In interfaceBd.c, I changed:

int taskHandle to TaskHandle taskHandle and it compiled correctly.

 

Now it compiles every file OK, but at the end I am getting several Project link erorrs pertaining to the interfaceBd.c file.

 

Undefined symbol '_DAQmxResetDevice@4' referenced in "interfaceBd.c"

Undefined symbol '_DAQmxCreateDIChan@16' referenced in "interfaceBd.c"

Undefined symbol '_DAQmxCreateDOChan@16' referenced in "interfaceBd.c"

And many more.

 

The Interface.bd compiled correctly so it did find the NIDAQmx.h file that has these functions in it.

 

So close!

 

Thanks

John W.

 

0 Kudos
Message 18 of 24
(4,295 Views)

Do you have the NI-DAQmx driver installed?

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Message 19 of 24
(4,288 Views)

I do.

 

I finally added the NIDAQMx.lib to the project and it finally built and ran.

I don't understand why I had to add the lib file to my project when I had it's path included in the enviornment include paths. But it works.

 

One more question. I tried to add WSock32.lib into the library file in the project. When I tried this a popup came up saying:

 

"Error writing project file"

"C:\workingdata\TEST PROJECT\etc\test.prj"

(An unspecified error has occurred, probably due to corrupted data" 

 

How can I fix this so I can add the WSock32.lib to my project?

 

Thanks

John W.

 

 

 

0 Kudos
Message 20 of 24
(4,283 Views)